Functions
New additions in V1 are indicated with a light bulb ๐ก icon.
Animator creation overviewโ
Asset creation overviewโ
Animator As Code (AacV1)โ
static AacFlBase Create(AacConfiguration configuration)
Create an Animator As Code (AAC) base.
Base (AacFlBase)โ
Create assetsโ
-
AacFlClip NewClip()
Create a new clip. The asset is generated into the container. -
AacFlClip CopyClip(AnimationClip originalClip)
Create a new clip that is a copy oforiginalClip. The asset is generated into the container. -
AacFlNonInitializedBlendTree NewBlendTree()๐ก
Create a new BlendTree asset. The asset is generated into the container. -
BlendTree NewBlendTreeAsRaw()
Create a new BlendTree asset and returns a native BlendTree object. The asset is generated into the container.๐ก You may use NewBlendTree() instead to obtain a fluent interface. -
AacFlClip NewClip(string name)
Create a new clip with a name. However, the name is only used as a suffix for the asset. The asset is generated into the container. -
AacFlNonInitializedBlendTree NewBlendTree(string name)(๐ ๏ธ Will be added in 1.3.0)
Create a new BlendTree asset with a name. However, the name is only used as a suffix for the asset. The asset is generated into the container. -
BlendTree NewBlendTreeAsRaw(string name)(๐ ๏ธ Will be added in 1.3.0)
Create a new BlendTree asset with a name and returns a native BlendTree object. However, the name is only used as a suffix for the asset. The asset is generated into the container. You may use NewBlendTree() instead to obtain a fluent interface. -
AacFlClip DummyClipLasting(float numberOf, AacFlUnit unit)
Create a new clip which animates a dummy transform for a specific duration specified in an unit (Frames or Seconds). -
AacFlController NewAnimatorController()๐ก
Create a new animator controller. The asset is generated into the container. -
AacFlController NewAnimatorController(string name)๐ก
Create a new animator controller with a name. However, the name is only used as a suffix for the asset. The asset is generated into the container. -
T DuplicateAsset<T>(T assetToDuplicate) where T : Object๐ก
Duplicate a new asset into the container and return it. For example, use this to create modified material variants. This asset will be removed the same way as other generated assets. -
AacFlModification Modification()(๐ ๏ธ Will be added in 1.3.0)
Returns a new AacFlModification instance, granting you access to the destructive modification API. You will need to reuse this instance throughout.
Reference VRChat assetsโ
See functions specific to VRChat.
Maintain assetsโ
void ClearPreviousAssets()
Removes all assets from the asset container matching the specified asset key.
Create layers (Destructive workflow)โ
For VRChat-specific functions, see VRChat (Destructive workflow)
-
AacFlLayer CreateMainArbitraryControllerLayer(AnimatorController controller)
Create a main layer for an arbitrary AnimatorController, clearing the previous one of the same system. You are not obligated to have a main layer. -
AacFlLayer CreateSupportingArbitraryControllerLayer(AnimatorController controller, string suffix)
Create a supporting layer for an arbitrary AnimatorController, clearing the previous one of the same system and suffix. You can create multiple supporting layers with different suffixes, and you are not obligated to have a main layer to create a supporting layer. -
AacFlLayer CreateFirstArbitraryControllerLayer(AnimatorController controller)
Clears the topmost layer of an arbitrary AnimatorController, and returns it.
Remove layers (Destructive workflow)โ
See functions specific to VRChat (Destructive workflow)
Create parameters without an animator๐กโ
AacFlNoAnimator NoAnimator()๐ก
If you are not creating an animator, this returns an object from which you can obtain animator parameter objects. You should use this class if you are creating BlendTree assets without any animator controllers to back it. Otherwise, it is strongly recommended to obtain animator parameter objects directly from the layer objects instead of using NoAnimator(), as the use of NoAnimator() will not result in the registration of any parameters inside the animator controller.
Controller (AacFlController)๐กโ
-
AnimatorController AnimatorControllerExposes the underlying Unity AnimatorController. -
AacFlLayer NewLayer(string suffix)๐ก
Create a new layer with a specific suffix. You cannot create multiple layers with the same suffix on the same controller. -
AacFlLayer NewLayer()๐ก
Create a new layer. You cannot invoke this method multiple times on the same controller.
Layer (AacFlLayer)โ
-
AacFlStateMachine StateMachine =>
Exposes the underlying AnimatorAsCode StateMachine object of this layer. -
AacFlState NewState(string name)๐บ
Create a new state, initially positioned below the last generated state of this layer.
๐บ If the name is already used, a number will be appended at the end. -
AacFlState NewState(string name, int x, int y)๐บ
Create a new state at a specific positionxandy, in grid units. The grid size is defined in the DefaultsProvider of the AacConfiguration of AAC.xpositive goes right,ypositive goes down.
๐บ If the name is already used, a number will be appended at the end. -
AacFlStateMachine NewSubStateMachine(string name)๐ก
Create a new state machine, initially positioned below the last generated state of this layer.
๐บ If the name is already used, a number will be appended at the end. -
AacFlStateMachine NewSubStateMachine(string name, int x, int y)๐ก
Create a new state machine at a specific positionxandy, in grid units. The grid size is defined in the DefaultsProvider of the AacConfiguration of AAC.xpositive goes right,ypositive goes down.
๐บ If the name is already used, a number will be appended at the end.
Create layer transitionsโ
-
AacFlTransition AnyTransitionsTo(AacFlState destination)
Create a transition from Any to thedestinationstate. -
AacFlTransition AnyTransitionsTo(AacFlStateMachine destination)
Create a transition from Any to thedestinationstate machine. -
AacFlEntryTransition EntryTransitionsTo(AacFlState destination)
Create a transition from the Entry to thedestinationstate. -
AacFlEntryTransition EntryTransitionsTo(AacFlStateMachine destination)
Create a transition from the Entry to thedestinationstate machine.
Create parametersโ
-
AacFlBoolParameter BoolParameter(string parameterName)
Create a Bool parameter in the animator. -
AacFlBoolParameter TriggerParameterAsBool(string parameterName)
Create a Trigger parameter in the animator, but returns a Bool parameter for use in AAC. -
AacFlFloatParameter FloatParameter(string parameterName)
Create a Float parameter in the animator. -
AacFlIntParameter IntParameter(string parameterName)
Create an Int parameter in the animator.
Create parameter groupsโ
-
AacFlBoolParameterGroup BoolParameters(params string[] parameterNames)
Create multiple Bool parameters in the animator, and returns a group of multiple Bools. -
AacFlBoolParameterGroup TriggerParametersAsBools(params string[] parameterNames)
Create multiple Trigger parameters in the animator, but returns a group of multiple Bools for use in AAC. -
AacFlFloatParameterGroup FloatParameters(params string[] parameterNames)
Create multiple Float parameters in the animator, and returns a group of multiple Bools. -
AacFlIntParameterGroup IntParameters(params string[] parameterNames)
Create multiple Int parameters in the animator, and returns a group of multiple Bools. -
AacFlBoolParameterGroup BoolParameters(params AacFlBoolParameter[] parameters)
Combine multiple Int parameters into a group. -
AacFlBoolParameterGroup TriggerParametersAsBools(params AacFlBoolParameter[] parameters)
Combine multiple Trigger parameters into a group. FIXME: This is a pointless function because BoolParameters already exists. -
AacFlFloatParameterGroup FloatParameters(params AacFlFloatParameter[] parameters)
Combine multiple Int parameters into a group. -
AacFlIntParameterGroup IntParameters(params AacFlIntParameter[] parameters)
Combine multiple Int parameters into a group.
Set animator parameter valueโ
-
AacFlLayer OverrideValue(AacFlBoolParameter toBeForced, bool value)
Set the Bool value oftoBeForcedparameter tovaluein the animator. -
AacFlLayer OverrideValue(AacFlFloatParameter toBeForced, float value)
Set the Float value oftoBeForcedparameter tovaluein the animator. -
AacFlLayer OverrideValue(AacFlIntParameter toBeForced, int value)
Set the Int value oftoBeForcedparameter tovaluein the animator. -
`AacFlLayer CopyParametersAndOverridesTo(AacFlLayer otherLayer)๐ก
Copy all created parameters to the other layer, and overrides it with a value if a value was stored.
Edit avatar maskโ
-
AacFlLayer WithAvatarMask(AvatarMask avatarMask)
Set the Avatar Mask of the layer. -
AacFlLayer WithAvatarMaskNoTransforms()
Set the Avatar Mask of the layer to be an Avatar Mask which denies all transforms. The asset is generated into the container. -
AacFlLayer ResolveAvatarMask(Transform[] paths)
Set the Avatar Mask of the layer to be an Avatar Mask that allows the specified transforms. Ifpathsis an empty array, all transforms are denied, which is effectively the same as calling.WithAvatarMaskNoTransforms(). The asset is generated into the container.
Edit layer attributesโ
-
AacFlLayer WithWeight(float weight)
Set the weight of the layer. -
AacFlLayer WithBlendingMode(AnimatorLayerBlendingMode blendingMode)
Set the blending mode of the layer.
Sub State Machine (AacFlStateMachine)๐กโ
-
AnimatorStateMachine Machine;
Exposes the underlying Unity AnimatorStateMachine object of this state machine. -
AacFlStateMachine NewSubStateMachine(string name)๐ก
Create a new state machine, initially positioned below the last generated state of this layer.
๐บ If the name is already used, a number will be appended at the end. -
AacFlNewTransitionContinuation Restarts()๐ก
Creates a new transition of the entire state machine node to itself, which is evaluated after the state machine commits to an exit transitions. -
AacFlNewTransitionContinuation Exits()๐ก
Create a transition from this state machine node to the exit.