Nodes
NodeIdentifier
DazNode
- class dazpy.DazNode(client, identifier)[source]
Bases:
DazElementProxy for a
DzNodein the active DAZ Studio scene.Provides access to transforms, hierarchy, visibility, materials, modifiers, and geometry. Instances are typically obtained from
DazScenerather than constructed directly.All properties that read from the server may return
Noneif the node no longer exists in the scene.- Parameters:
identifier (NodeIdentifier) – Identifies the underlying
DzNode.
- property position: dict | None
World-space position as
{"x": float, "y": float, "z": float}(read-only).Use
set_position()to change.
- property rotation: dict | None
World-space rotation as
{"x", "y", "z", "w"}quaternion (read-only).Use
set_rotation()to change (accepts Euler angles in degrees).
- property scale: dict | None
Per-axis and uniform scale as
{"x", "y", "z", "general"}(read-only).Use
set_scale()to change the per-axis values.
- set_scale(x, y, z)[source]
Set per-axis local scale.
Does not affect the general/uniform scale dial (
general_scale) — DAZ Studio tracks per-axis and uniform scale as separate controls.
- set_transform(position=None, rotation=None, scale=None)[source]
Set any combination of local position, rotation, and scale in one call.
Every argument is optional. Omitted components are left untouched. Equivalent to calling
set_local_position(),set_local_rotation(), and/orset_scale()individually, but round-trips only once.- Parameters:
position (tuple[float, float, float] | None) –
(x, y, z)local-space position, orNoneto leave unchanged.rotation (tuple[float, float, float] | None) –
(x, y, z)Euler rotation in degrees, orNoneto leave unchanged.scale (tuple[float, float, float] | None) –
(x, y, z)per-axis scale, orNoneto leave unchanged.
- property visible: bool | None
General visibility flag (read/write).
Affects both viewport and render visibility unless overridden by the per-channel visibility setters.
- delete()[source]
Remove this node from the scene entirely.
- Returns:
Trueif the node was found and removed,Falseotherwise.- Return type:
- reparent(new_parent, *, preserve_world_transform=True)[source]
Move this node to a new position in the scene hierarchy.
Detaches the node from its current parent (if any) and attaches it as a child of new_parent, following the
removeNodeChild/addNodeChildDazScript pattern.- Parameters:
new_parent (DazNode) – The node to reparent under.
preserve_world_transform (bool) – When
True(default), the node keeps its current world-space position/rotation/scale, adjusting its local transform to compensate. WhenFalse, the node’s local transform values are left unchanged, which may move it in world space.
- Raises:
ScriptRuntimeError – If the reparent operation fails (e.g. new_parent cannot be found, or would create a cycle).
- modifiers()[source]
Return all modifiers (morphs, constraints, etc.) on this node.
- Returns:
A list of
DazMorphandDazModifierinstances.- Return type:
list[‘DazModifier’]
- find_modifier(name)[source]
Find a modifier by internal name.
- Parameters:
name (str) – The
getName()string of the modifier.- Returns:
A
DazMorphorDazModifier, orNoneif not found.- Return type:
DazModifier | None
- find_material(name)[source]
Find a surface material by name.
- Parameters:
name (str) – The material’s
getName()string.- Returns:
A
DazMaterialproxy, orNoneif not found.- Return type:
DazMaterial | None
- find_modifier_by_label(label)[source]
Find a modifier by its user-visible label (the name shown in the DAZ UI).
DAZ Studio morphs have both an internal name (e.g.
"PHMSmileFull") and a display label (e.g."Smile Full Face").find_modifier()matches the internal name; this method matches the label instead.- Parameters:
label (str) – The
getLabel()string shown in the Parameters pane.- Returns:
A
DazMorphorDazModifier, orNoneif no modifier with that label exists.- Return type:
DazModifier | None
- find_property(name)[source]
Find a node-level property by its internal name.
This searches properties directly on the node (via
DzNode::findProperty), which covers pose controls, FACS dials, and other parameter channels that are not geometry modifiers and therefore invisible tofind_modifier().- Parameters:
name (str) – The
getName()/ ID string of the property (e.g."facs_ctrl_SmileFullFace").- Returns:
A
DazPropertyproxy, orNoneif not found.- Return type:
DazProperty | None
- find_property_by_label(label)[source]
Find a node-level property by its user-visible label.
Equivalent to
find_property()but matches ongetLabel()instead ofgetName(). Use this when you know the label shown in the DAZ Studio Parameters pane (e.g."Smile Full Face") but not the internal ID.- Parameters:
label (str) – The
getLabel()string shown in the Parameters pane.- Returns:
A
DazPropertyproxy, orNoneif not found.- Return type:
DazProperty | None
- dforce_modifiers()[source]
Return only the dForce simulation modifiers on this node (convenience filter).
- set_position_at_frame(frame, x, y, z)[source]
Write a real keyframe for world-space position at timeline frame.
Unlike
set_position(), this writes an actual animation curve key (viaDzNode.setWSPos(tm, pos)) rather than the “current” value — the position at frames between keys is DAZ Studio’s own interpolation, not something the caller has to bake per-frame.frame is converted to DAZ Studio time ticks via the scene’s current
Scene.getTimeStep()(ticks per frame), not a hardcoded constant — that value depends on the scene’s frame rate.
- set_rotation_at_frame(frame, x, y, z)[source]
Write a real keyframe for world-space Euler rotation at timeline frame.
Companion to
set_position_at_frame()— see its docstring for the tick-conversion note. Writes to the same per-axis rotation controls asset_rotation(), but as a keyed value at frame rather than the “current” value.
- clear_position_keys()[source]
Remove all keyframes from this node’s X/Y/Z position controls.
Newly-created nodes can already carry a default key (e.g. a preset camera position at its creation time); call this before writing a fresh animated curve with
set_position_at_frame(), otherwise the leftover default key distorts interpolation/extrapolation around the new keys.
- clear_rotation_keys()[source]
Remove all keyframes from this node’s X/Y/Z rotation controls.
See
clear_position_keys()— same rationale, for orientation.
- property local_euler: tuple[float, float, float] | None
Local-space rotation as an
(x, y, z)tuple of Euler angles in degrees.Reads the rotation controls written by
set_local_rotation(), so the two are exact inverses.- Returns:
(x, y, z)in degrees, orNoneif the node cannot be found.
- property local_rotation: dict | None
Local-space rotation as
{"x", "y", "z", "w"}quaternion (read-only).
- select(on=True)[source]
Select or deselect this node.
- Parameters:
on (bool) –
Trueto select,Falseto deselect.
- set_visible_in_render(on)[source]
Set render visibility.
- Parameters:
on (bool) –
Trueto show in render,Falseto hide.
- set_visible_in_viewport(on)[source]
Set viewport visibility.
- Parameters:
on (bool) –
Trueto show,Falseto hide.
- bounding_box()[source]
Return the world-space axis-aligned bounding box.
- Returns:
A dict
{"min": {"x", "y", "z"}, "max": {"x", "y", "z"}}orNoneif the node has no geometry.- Return type:
dict | None
- fit_to(figure)[source]
Fit this clothing/hair/prop node to a base figure.
For figure-based conforming clothing and hair (nodes exposing
setFollowTarget/followSkeleton), this sets the follow relationship so the item deforms with the figure’s pose. For plain props/accessories, it falls back to parenting the item under the figure, preserving its current world-space transform.- Parameters:
figure (DazNode) – The target base figure node. Must already be loaded into the scene.
- Returns:
"setFollowTarget","followSkeleton", or"addNodeChild"(parenting fallback).- Return type:
The DazScript API used
- Raises:
NodeNotFoundError – If this node or figure cannot be found.
- unfit()[source]
Remove this node’s fitting relationship with its figure.
Clears any follow-target relationship (conforming clothing/hair) and detaches this node from its parent skeleton (props), leaving it as a free-standing scene node at its current world position.
- Returns:
"previous_figure"— internal name of the figure this node was fitted to, orNoneif it had no fitting relationship."actions"— list of operations performed (e.g.["cleared follow target", "detached from parent"]), or[]if nothing was fitted.
- Return type:
A dict with keys
DazElement
- class dazpy.DazElement(client, locator)[source]
Bases:
objectGeneric proxy for any DzElement subclass. Base class for all typed proxies.
You normally do not instantiate
DazElementdirectly. Use the typed subclasses (DazNode,DazMaterial, etc.) returned byDazSceneand related helpers instead.- Parameters:
- numeric_properties()[source]
Return every numeric property on this element as
{label: value}.Unlike
list_properties(), this fetches labels and current values for all numeric (float/int/bool) properties in a single HTTP round-trip — use it instead of callingget_property()in a loop overlist_properties()results.
- property class_name: str | None
The DazScript class name of this element (e.g.
"DzFigure","DzSpotLight").