Table of Contents

Class MusclePoseSystem

Muscle-based pose system - HELPER layer only Never writes to AnimationClip directly Forwards all bone transforms to BonePoseSystem

public class MusclePoseSystem
Inheritance
MusclePoseSystem
Inherited Members

Constructors

MusclePoseSystem(Animator, SkeletonCache, BonePoseSystem)

public MusclePoseSystem(Animator animator, SkeletonCache skeleton, BonePoseSystem bonePoseSystem)

Parameters

animator Animator
skeleton SkeletonCache
bonePoseSystem BonePoseSystem

Properties

MuscleValues

public float[] MuscleValues { get; }

Property Value

float[]

Methods

ConstrainAndApply(bool)

Full muscle-based IK result pipeline — the ONLY correct way to apply IK on a Humanoid rig so that joint limits are enforced and the muscle editor stays in sync.

Pipeline:

  1. GetHumanPose → converts bone transforms → normalised muscle values. Unity auto-clamps each value to [−1, 1], which is the humanoid joint-limit enforcement.
  2. muscleValues[] is updated so the Muscle Editor UI reflects the result.
  3. SetHumanPose → writes the clamped muscles back to bone transforms. This is identical to what Animation Rigging does internally after its own IK passes.
  4. All bone rotations AND the root (Hips) position are forwarded to the authoritative BonePoseSystem.
  5. CommitPose is called (conditionally) to write animation keys.
public void ConstrainAndApply(bool commitPose = true)

Parameters

commitPose bool

GetHumanPose()

Get the current HumanPose with latest muscle values

public HumanPose GetHumanPose()

Returns

HumanPose

GetMuscleLimits(int)

Get muscle limits

public Vector2 GetMuscleLimits(int index)

Parameters

index int

Returns

Vector2

GetMuscleName(int)

Get muscle name for UI display

public string GetMuscleName(int index)

Parameters

index int

Returns

string

ResetToTPose(bool)

Reset all muscles to T-Pose (0 values)

public void ResetToTPose(bool autoKey = true)

Parameters

autoKey bool

SetAllMuscles(float[], bool)

Set all muscle values at once

public void SetAllMuscles(float[] values, bool autoKey = true)

Parameters

values float[]
autoKey bool

SetMuscle(int, float, bool)

Set a specific muscle value and apply to skeleton Forwards resulting bone rotations to BonePoseSystem

public void SetMuscle(int muscleIndex, float value, bool autoKey = true)

Parameters

muscleIndex int
value float
autoKey bool

SyncFromSkeleton()

Read current skeleton state into muscle values

public void SyncFromSkeleton()