Class PoseData
Data structure for storing and managing human poses. Uses Unity's HumanPose muscle space for rig-agnostic storage.
[Serializable]
public class PoseData
- Inheritance
-
PoseData
- Inherited Members
Constructors
PoseData()
Create empty pose data
public PoseData()
PoseData(HumanPose, string)
Create a new pose data from HumanPose
public PoseData(HumanPose humanPose, string name = "New Pose")
Parameters
humanPoseHumanPosenamestring
Fields
author
public string author
Field Value
category
public string category
Field Value
description
public string description
Field Value
poseName
public string poseName
Field Value
thumbnail
public Texture2D thumbnail
Field Value
- Texture2D
thumbnailPath
public string thumbnailPath
Field Value
timestamp
public long timestamp
Field Value
version
public string version
Field Value
Properties
BodyPosition
Properties for accessing pose data
public Vector3 BodyPosition { get; }
Property Value
- Vector3
BodyRotation
public Quaternion BodyRotation { get; }
Property Value
- Quaternion
Muscles
public float[] Muscles { get; }
Property Value
- float[]
Methods
BlendWith(PoseData, float)
Blend this pose with another pose
public PoseData BlendWith(PoseData otherPose, float t)
Parameters
Returns
ClampMuscleValues()
Clamp all muscle values to valid range
public void ClampMuscleValues()
Clone()
Create a copy of this pose data
public PoseData Clone()
Returns
CreateMirrored()
Mirror this pose (left-right flip)
public PoseData CreateMirrored()
Returns
FromJson(string)
Create pose from JSON string
public static PoseData FromJson(string json)
Parameters
jsonstring
Returns
IsValid()
Validate pose data integrity
public bool IsValid()
Returns
ToHumanPose()
Convert this pose data to HumanPose
public HumanPose ToHumanPose()
Returns
- HumanPose
ToHumanPoseMusclesOnly(ref HumanPose)
Converts to HumanPose but keeps the target's current world position and rotation. Useful to prevent the avatar from teleporting when applying a pose.
public HumanPose ToHumanPoseMusclesOnly(ref HumanPose currentTargetPose)
Parameters
currentTargetPoseHumanPose
Returns
- HumanPose
ToJson(bool)
Get pose as JSON string
public string ToJson(bool prettyPrint = false)
Parameters
prettyPrintbool
Returns
UpdateFromHumanPose(HumanPose)
Update pose data from HumanPose
public void UpdateFromHumanPose(HumanPose humanPose)
Parameters
humanPoseHumanPose
ValidateMuscleArraySize()
public void ValidateMuscleArraySize()