Skeleton & Bones
DazSkeleton
- class dazpy.DazSkeleton(client, identifier)[source]
Bases:
DazNodeProxy for a
DzSkeleton(a rigged figure such as Genesis 9).Extends
DazNodewith bone-access helpers.- find_bone(name)[source]
Find a bone by its internal name.
- Parameters:
name (str) – The
getName()string of the bone. Naming conventions differ by figure generation: Genesis 9 uses snake_case (e.g."r_forearm"); Genesis 3/8 uses"rForearmBend"/"lForearmBend"; Genesis 1/2 uses"rForeArm"/"lForeArm". Usebones()to list every bone name for the loaded figure.- Returns:
A
DazBoneproxy.- Raises:
NodeNotFoundError – If no bone with that name exists.
- Return type:
- find_bone_by_label(label)[source]
Find a bone by its user-visible label.
- Parameters:
label (str) – The
getLabel()string of the bone.- Returns:
A
DazBoneproxy.- Raises:
NodeNotFoundError – If no bone with that label exists.
- Return type:
- bone_rotations()[source]
Return Euler rotations for every bone in one HTTP call.
Equivalent to calling
local_euleron every bone returned bybones(), but rounds-trips only once.
- set_bone_rotations(data)[source]
Set Euler rotations for any subset of bones in one HTTP call.
Only the bones named in data are modified; all others are unchanged. Equivalent to calling
set_local_rotation()per bone, but rounds-trips only once.
- morph_values(nonzero_only=False)[source]
Return the current value of every DzMorph modifier in one HTTP call.
- set_morph_values(data)[source]
Set the value of any subset of morphs in one HTTP call.
Only morphs named in data are modified; all others are unchanged.
- bake_bone_rotations(start=None, end=None, bone_names=None)[source]
Bake bone rotation keyframes for every frame in the range.
Scrubs the timeline server-side. For each frame, the current evaluated X/Y/Z rotation of every bone (including IK, constraints, and driven keys) is stamped as an explicit keyframe via
insertKey. After baking, the animation plays back without requiring any of the original drivers.The original frame is restored before the call returns.
- Parameters:
- Returns:
{"frames_baked": int, "bones_baked": int}- Raises:
NodeNotFoundError – If the skeleton is not found.
- Return type:
- bake_morphs(start=None, end=None, morph_names=None)[source]
Bake morph channel keyframes for every frame in the range.
For each frame, the current value of every
DzMorphmodifier is stamped as an explicit keyframe viainsertKey.The original frame is restored before the call returns.
- bake(start=None, end=None, bone_names=None, include_morphs=False, morph_names=None)[source]
Bake bone rotations and optionally morphs in a single HTTP call.
Combines
bake_bone_rotations()andbake_morphs()into one server-side loop so the timeline is only scrubbed once.- Parameters:
start (int | None) – First frame to bake.
None→ play-range start.end (int | None) – Last frame to bake.
None→ play-range end.bone_names (list[str] | None) – Bones to bake.
None→ all bones.include_morphs (bool) – Also bake
DzMorphchannels.morph_names (list[str] | None) – Morphs to bake (only used when include_morphs is
True).None→ all morphs.
- Returns:
{"frames_baked": int, "bones_baked": int, "morphs_baked": int}- Return type:
DazBone
- class dazpy.DazBone(client, identifier)[source]
Bases:
DazNodeProxy for a
DzBone(a single joint within aDazSkeleton).Extends
DazNodewith bone-specific rotation helpers.- property local_euler: tuple[float, float, float] | None
Local-space rotation as an
(x, y, z)tuple of Euler angles in degrees.Reads the same rotation controls written by
set_local_rotation(), so the two are exact inverses.- Returns:
(x, y, z)in degrees, orNoneif the bone cannot be found.
- property local_rotation: dict | None
Local-space rotation as
{"x", "y", "z", "w"}quaternion (read-only).
- get_skeleton()[source]
Return the parent
DazSkeleton, orNone.