Class MuscleSpaceDriver

Namespace
CodeSmile.AnyMotion.AnimateYourself.Spaces
/
Assembly
ApiSource.dll

Space A: writes Mecanim muscle values through HumanPoseHandler.

public sealed class MuscleSpaceDriver : IGaitDriverSpace
Expand Details ...
Inheritance
object
MuscleSpaceDriver
Implements

Remarks

Included to measure motion quality against, not as a candidate architecture. Its limits are structural rather than fixable:

  • Whole-body write. SetHumanPose writes every bone, so masking is impossible and any earlier writer is overwritten — including Animation Rigging, which evaluates inside the Animator's playable graph and therefore before this runs in LateUpdate.
  • Main thread only. Removes the Burst/Jobs route that R4's 50-character target needs.
  • No limb targets. Muscle values are joint angles, so a foot cannot be placed at a chosen point. R10's geometry avoidance cannot be expressed at all.

What it does give free: per-avatar joint limits. Values are normalised to −1..1 against each rig's own configured range, so a value of 1 means "as far as this rig allows" and can never produce an impossible joint angle. That property is worth keeping in whatever space wins, and it is why the normalisation here reads the limits from HumanTrait rather than assuming any.

Properties

BindError

Reason Bind(Animator, RigMetrics, BindPose) failed, or null.

public string BindError { get; }

Property Value

string

DisplayName

Short label for the comparison table.

public string DisplayName { get; }

Property Value

string

Kind

public GaitDriverSpaceKind Kind { get; }

Property Value

GaitDriverSpaceKind

SupportsAnimationRigging

False when this space overwrites whatever Animation Rigging produced, making the two mutually exclusive.

public bool SupportsAnimationRigging { get; }

Property Value

bool

SupportsLimbTargets

False when the space cannot place a hand or foot at a chosen point, which R10 requires.

public bool SupportsLimbTargets { get; }

Property Value

bool

SupportsMasking

False when the space can only write the whole body, so partial-body jank is impossible.

public bool SupportsMasking { get; }

Property Value

bool

Methods

Apply(in GaitPose, float)

Writes the pose to the rig. weight blends between the bind pose at 0 and the full gait at 1, which the distance LOD tiers of R4 need in order to fade a tier in and out rather than switch it.

public void Apply(in GaitPose pose, float weight)

Parameters

Type Name Description
GaitPose
pose
float
weight

Bind(Animator, RigMetrics, BindPose)

Prepares the space for one rig. Returns false and sets BindError on failure.

public bool Bind(Animator animator, RigMetrics metrics, BindPose bindPose)

Parameters

Type Name Description
Animator
animator
RigMetrics
metrics
BindPose
bindPose

Reference pose to restore to before each write, resolved once by the caller so that all spaces share it. Never read this from the live Transforms: doing so lets an animated pose become the reference, after which rotations stack on a pose that already contains a frame of gait.

Returns

bool

Remarks

bindPose is unused here. SetHumanPose writes every muscle value absolutely, so this space has no previous-frame state to restore and cannot accumulate drift.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()