AnimatorController

m

structure

AnimatorController

Layers

AnimatorControllerLayer[]

"Base Layer"

AnimatorStateMachine

ChildAnimatorStateMachine[]

ChildAnimatorState[]

AnimatorState

Motion

BlendTree

Motion

Motion

Motion

AnimatorStateTransition

.destinationState

// Ugh. No sourceState, Must pass in on call...

.destinationStateMachine

anyStateTransitions

"Loop"

Parameter

Float

Int

Bool

Trigger

// Auto set to false, on set to true

SKIP_EMPTYCLIP_TRUE

(must be true)

Feature

SkipAnimClipState

AnimatorState

AnimatorStateTransition

(config)

IN

// UGH...must loop through all transition and match up destination name to current AnimatorState and Collect entries. Sucks.

OUT

// Easy

(config)

(SKIP)

Has Exit Time == False

When set to false, animation will be stuck if there are no conditions to transition it forward

(Conditions)

SKIP_EMPTYCLIP_TRUE = True

InterruptionSource = NextState

(Stepped Transition)

TransitionDuration = 0

TransitionOffSet = 0

TODO :

if (populated)

UNDO THESE SETTINGS

if transitioning to empty clip

TURN OFF hasExitTime

Non Base Layers

if clips are empty

Don't populate

Bring Layer influence level == 0

API

Editor

AnimatorControllerSetup.cs

[MenuItem("Assets/AnimatorSetup/ControllerSetup")]

static

void

ControllerSetup()

if (Selection.activeObject is AnimatorController) { ... }

var animatorControllerPath = AssetDatabase.GetAssetPath(Selection.activeObject);

var animatorController = AssetDatabase.LoadAssetAtPath<AnimatorController>(animatorControllerPath);

(processors)

(Motion, AnimatorState)

ProcessAnimatorMotions<T>(AnimatorStateMachine animatorStateMachine, Func<Motion, AnimatorState, T> callBack) { ... }

(AnimatorStateTransition, AnimatorState)

ProcessStateTransitions<T>(AnimatorState state, AnimatorStateMachine machine, Func<AnimatorStateTransition, AnimatorState, T> callBack) {

// Ugh. No way to relate AnimatorState to it's AnimatorStateMachine. Must pass in on call...