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.
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 AnimatorController
Exposes 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 positionx
andy
, in grid units. The grid size is defined in the DefaultsProvider of the AacConfiguration of AAC.x
positive goes right,y
positive 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 positionx
andy
, in grid units. The grid size is defined in the DefaultsProvider of the AacConfiguration of AAC.x
positive goes right,y
positive 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 thedestination
state. -
AacFlTransition AnyTransitionsTo(AacFlStateMachine destination)
Create a transition from Any to thedestination
state machine. -
AacFlEntryTransition EntryTransitionsTo(AacFlState destination)
Create a transition from the Entry to thedestination
state. -
AacFlEntryTransition EntryTransitionsTo(AacFlStateMachine destination)
Create a transition from the Entry to thedestination
state 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 oftoBeForced
parameter tovalue
in the animator. -
AacFlLayer OverrideValue(AacFlFloatParameter toBeForced, float value)
Set the Float value oftoBeForced
parameter tovalue
in the animator. -
AacFlLayer OverrideValue(AacFlIntParameter toBeForced, int value)
Set the Int value oftoBeForced
parameter tovalue
in 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. Ifpaths
is 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.
No Animator (AacFlNoAnimator)π‘β
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.
-
AacFlFloatParameter FloatParameter(string parameterName)
π‘
Create a Float parameter, for use without a backing animator. -
AacFlIntParameter IntParameter(string parameterName)
π‘
Create an Int parameter, for use without a backing animator. -
AacFlBoolParameter BoolParameter(string parameterName)
π‘
Create a Bool parameter, for use without a backing animator. -
AacFlNoAnimator OverrideValue(AacFlFloatParameter toBeForced, float value)
π‘
Stores the Float value oftoBeForced
parameter tovalue
, which will be used in the CopyParametersAndOverridesTo() function. -
AacFlNoAnimator OverrideValue(AacFlIntParameter toBeForced, int value)
π‘
Stores the Int value oftoBeForced
parameter tovalue
, which will be used in the CopyParametersAndOverridesTo() function. -
AacFlNoAnimator OverrideValue(AacFlBoolParameter toBeForced, bool value)
π‘
Stores the Bool value oftoBeForced
parameter tovalue
, which will be used in the CopyParametersAndOverridesTo() function. -
AacFlNoAnimator CopyParametersAndOverridesTo(AacFlLayer otherLayer)
π‘
Copy all created parameters to the other layer, and overrides it with a value if a value was stored.
State (AacFlState)β
AnimatorState State
Expose the underlying AnimatorState object.
Graph Positioningβ
-
AacFlState LeftOf(AacFlState otherState)
Move the node the left of the other node in the graph. -
AacFlState RightOf(AacFlState otherState)
Move the node the right of the other node in the graph. -
AacFlState Over(AacFlState otherState)
Move the node to be over the other node in the graph. -
AacFlState Under(AacFlState otherState)
Move the node to be under the other node in the graph. -
AacFlState LeftOf()
Move the node to the left of the last created node of the state machine this belongs to in the graph. -
AacFlState RightOf()
Move the node to the right of the last created node of the state machine this belongs to in the graph. -
AacFlState Over()
Move the node to be over the last created node of the state machine this belongs to in the graph. -
AacFlState Under()
Move the node to be under the last created node of the state machine this belongs to in the graph. -
At(int x, int y)
Move the node to be at a specific position in grid units, where x positive goes right, and y positive goes down. -
AacFlState Shift(AacFlState otherState, int shiftX, int shiftY)
Move the state to be shifted next to the other state in the graph, in grid units. shiftX positive goes right, shiftY positive goes down. -
AacFlState Shift(Vector3 otherPosition, int shiftX, int shiftY)
Given another position in non-grid units, move the state to be shifted next to that position, in grid units. shiftX positive goes right, shiftY positive goes down.
Pathsβ
string ResolveRelativePath(Transform item)
Resolve the path of an item relative to the AnimatorRoot.
Attributesβ
-
AacFlState WithAnimation(Motion clip)
Set a specific raw Motion for the state. This could be a blend tree. -
AacFlState WithAnimation(AacFlClip clip)
Set a specific clip for the state. See(AacFlBase).NewClip()
and similar. -
AacFlState WithAnimation(AacFlBlendTree clip)
π‘
Set a specific blend tree for the state. See(AacFlBase).NewBlendTree()
and similar. -
AacFlState WithMotionTime(AacFlFloatParameter floatParam)
Set the Motion Time to a parameter. This was formerly known as Normalized Time. -
AacFlState WithCycleOffset(AacFlFloatParameter floatParam)
π‘
Set the Cycle Offset to a parameter. -
AacFlState WithCycleOffsetSetTo(float cycleOffset)
π‘
Set the Cycle Offset to a specific value. -
AacFlState WithSpeed(AacFlFloatParameter parameter)
π‘
Set the Speed to a parameter. -
AacFlState WithSpeedSetTo(float speed)
π‘
Set the Speed to a specific value. -
AacFlState WithWriteDefaultsSetTo(bool shouldWriteDefaults)
Set Write Defaults. If you need to do this to many states, consider changing the AacConfiguration DefaultsProvider when creating the AnimatorAsCode instance. -
AacFlState MotionTime(AacFlFloatParameter floatParam)
Obsolete.
Set the Motion Time to a parameter. This was formerly known as Normalized Time.
This is identical toWithMotionTime()
. This function is preserved for compatibility.
Transitionsβ
-
AacFlTransition TransitionsTo(AacFlState destination)
Create a new transition from this state to thedestination
state. -
AacFlTransition TransitionsTo(AacFlStateMachine destination)
Create a new transition from this state to thedestination
state machine. -
AacFlTransition TransitionsFromAny()
Create a new transition from Any to this state. -
AacFlEntryTransition TransitionsFromEntry()
Create a new transition from Entry to this state. Note that the first created state is the default state, so generally this function does not need to be invoked onto the first created state.
Calling this function will not define this state to be the default state. -
AacFlState AutomaticallyMovesTo(AacFlState destination)
Create a transition with no exit time to thedestination
state.
Calling this function does not return the transition. -
AacFlState AutomaticallyMovesTo(AacFlStateMachine destination)
Create a transition with no exit time to thedestination
state machine.
Calling this function does not return the transition. -
AacFlTransition Exits()
Create a transition from this state to the exit.
State behavioursβ
See functions specific to VRChat.
Clip (AacFlClip)β
AnimationClip Clip;
Expose the underlying Clip object.
Attributesβ
-
AacFlClip Looping()
Set the clip to be looping. -
AacFlClip NonLooping()
Set the clip to be non-looping.
Single-frame Animationsβ
Single-valued overloads do not tolerate null values, and will intentionally fail when provided with a null value.
Array overloads tolerate arrays that contain null values, but does not tolerate the array itself being null.
-
AacFlClip BlendShape(SkinnedMeshRenderer renderer, string blendShapeName, float value)
Change a blendShape of a skinned mesh. This lasts one frame. -
AacFlClip BlendShape(SkinnedMeshRenderer[] rendererWithNulls, string blendShapeName, float value)
Change a blendShape of multiple skinned meshes. This lasts one frame. The array can safely contain null values. -
AacFlClip Toggling(GameObject gameObject, bool value)
Enable or disable a GameObject. This lasts one frame. -
AacFlClip Toggling(GameObject[] gameObjectsWithNulls, bool value)
Enable or disable GameObjects. This lasts one frame. The array can safely contain null values. -
AacFlClip TogglingComponent(Component[] componentsWithNulls, bool value)
Toggle several components. This lasts one frame. The runtime type of each individual component will be used. The array can safely contain null values. -
AacFlClip TogglingComponent(Component component, bool value)
Toggle a component. This lasts one frame. The runtime type of the component will be used. -
AacFlClip SwappingMaterial(Renderer renderer, int slot, Material material)
Swap a material of a Renderer on the specified slot (indexed at 0). This lasts one frame. -
AacFlClip SwappingMaterial(ParticleSystem particleSystem, int slot, Material material)
Swap a material of a Particle System on the specified slot (indexed at 0). This lasts one frame.
In practice, this will animate the ParticleSystemRenderer of that particle system.