Pose
- class dazpy.DazPose(figure, bones, morphs, props)[source]
Bases:
objectA snapshot of a figure’s complete pose state.
Stores bone rotations (Euler XYZ degrees), geometry morph values, and node-level numeric properties. Sparse by default — zero values are omitted so the object stays compact for morph-heavy figures.
Typical workflow:
from dazpy import DazScene, DazPose scene = DazScene() figure = scene.find_skeleton_by_label("Genesis 9") neutral = DazPose.capture(figure) neutral.save("neutral.json") smile = DazPose.load("smile.json") neutral.lerp(smile, t=0.5).apply(figure)
JSON schema (same as
character_state.pyoutput):{ "figure": "Genesis 9", "bones": {"hip": [0, 2.3, 0], "rForeArm": [0, 0, -45]}, "morphs": {"PHMSmileFull": 0.8}, "props": {"facs_ctrl_SmileFullFace": 0.5} }
- Parameters:
- classmethod capture(skeleton)[source]
Capture the current pose of skeleton in a single HTTP call.
Records all non-zero bone rotations, morph values, and node-level numeric properties. Zero values are omitted (sparse storage); they are implied as 0.0 during
lerp()andapply_full().- Parameters:
skeleton (DazSkeleton) – The figure to capture.
- Returns:
A new
DazPose.- Raises:
NodeNotFoundError – If the skeleton is not found.
- Return type:
- classmethod load(path)[source]
Load a pose from a JSON file.
Accepts files produced by
save()and by thecharacter_state.pyexample script.
- lerp(other, t)[source]
Linearly interpolate between this pose and other.
Missing keys in either pose are treated as zero. The result uses the figure label from self.
This is a pure-Python operation — no HTTP round-trip.
- apply(skeleton)[source]
Apply this pose to skeleton in a single HTTP call.
Only channels present in the pose are changed. Bones and morphs not stored in the pose are left at their current values. Use
apply_full()when you need a clean, authoritative reset to exactly this pose.- Parameters:
skeleton (DazSkeleton) – The figure to pose.
- apply_full(skeleton)[source]
Apply this pose and zero every channel not present in the pose.
Unlike
apply(), every bone rotation, morph, and node property on the skeleton is explicitly set — channels absent from the pose are driven to zero. Use this to restore a known baseline cleanly.- Parameters:
skeleton (DazSkeleton) – The figure to pose.