Nodes

NodeIdentifier

class dazpy.NodeIdentifier(value, kind='name')[source]

Bases: object

Identifies a scene node by name or label.

value

The name or label string used to look up the node.

Type:

str

kind

Either "name" (uses Scene.findNode()) or "label" (uses Scene.findNodeByLabel()).

Type:

str

DazNode

class dazpy.DazNode(client, identifier)[source]

Bases: DazElement

Proxy for a DzNode in the active DAZ Studio scene.

Provides access to transforms, hierarchy, visibility, materials, modifiers, and geometry. Instances are typically obtained from DazScene rather than constructed directly.

All properties that read from the server may return None if the node no longer exists in the scene.

Parameters:
property label: str | None

User-visible display label shown in the Scene panel (read/write).

property name: str | None

Internal node name used to look up the node (read-only).

property position: dict | None

World-space position as {"x": float, "y": float, "z": float} (read-only).

Use set_position() to change.

set_position(x, y, z)[source]

Set the world-space position of this node.

Parameters:
  • x (float) – X coordinate in DAZ Studio units (centimetres by default).

  • y (float) – Y coordinate.

  • z (float) – Z coordinate.

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 general_scale: float | None

Uniform scale factor (read-only).

property scale: dict | None

Per-axis and uniform scale as {"x", "y", "z", "general"} (read-only).

property visible: bool | None

General visibility flag (read/write).

Affects both viewport and render visibility unless overridden by the per-channel visibility setters.

property parent: DazNode | None

Parent node in the scene hierarchy, or None for root nodes.

property children: list[DazNode]

Direct child nodes.

modifiers()[source]

Return all modifiers (morphs, constraints, etc.) on this node.

Returns:

A list of DazMorph and DazModifier instances.

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 DazMorph or DazModifier, or None if not found.

Return type:

DazModifier | None

materials()[source]

Return all surface materials on this node’s current shape.

find_material(name)[source]

Find a surface material by name.

Parameters:

name (str) – The material’s getName() string.

Returns:

A DazMaterial proxy, or None if 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 DazMorph or DazModifier, or None if 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 to find_modifier().

Parameters:

name (str) – The getName() / ID string of the property (e.g. "facs_ctrl_SmileFullFace").

Returns:

A DazProperty proxy, or None if 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 on getLabel() instead of getName(). 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 DazProperty proxy, or None if not found.

Return type:

DazProperty | None

morphs()[source]

Return only the morph modifiers on this node (convenience filter).

set_rotation(x, y, z)[source]

Set the world-space rotation using Euler angles in degrees.

Parameters:
  • x (float) – Rotation around the X axis in degrees.

  • y (float) – Rotation around the Y axis in degrees.

  • z (float) – Rotation around the Z axis in degrees.

property local_position: dict | None

Local-space position as {"x", "y", "z"} (read-only).

set_local_position(x, y, z)[source]

Set the local-space position of this node.

Parameters:
  • x (float) – X coordinate relative to the parent.

  • y (float) – Y coordinate.

  • z (float) – Z coordinate.

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, or None if the node cannot be found.

property local_rotation: dict | None

Local-space rotation as {"x", "y", "z", "w"} quaternion (read-only).

set_local_rotation(x, y, z)[source]

Set the local-space rotation using Euler angles in degrees.

Parameters:
  • x (float) – Rotation around the local X axis in degrees.

  • y (float) – Rotation around the local Y axis in degrees.

  • z (float) – Rotation around the local Z axis in degrees.

is_selected()[source]

Return True if this node is currently selected.

select(on=True)[source]

Select or deselect this node.

Parameters:

on (bool) – True to select, False to deselect.

is_in_scene()[source]

Return True if this node is still part of the active scene.

is_root()[source]

Return True if this node has no parent (top-level node).

is_visible_in_render()[source]

Return True if this node is visible in render output.

set_visible_in_render(on)[source]

Set render visibility.

Parameters:

on (bool) – True to show in render, False to hide.

is_visible_in_viewport()[source]

Return True if this node is visible in the 3D viewport.

set_visible_in_viewport(on)[source]

Set viewport visibility.

Parameters:

on (bool) – True to show, False to hide.

bounding_box()[source]

Return the world-space axis-aligned bounding box.

Returns:

A dict {"min": {"x", "y", "z"}, "max": {"x", "y", "z"}} or None if the node has no geometry.

Return type:

dict | None

property geometry_vertex_count: int | None

Total vertex count of this node’s current geometry, or None.

DazElement

class dazpy.DazElement(client, locator)[source]

Bases: object

Generic proxy for any DzElement subclass. Base class for all typed proxies.

You normally do not instantiate DazElement directly. Use the typed subclasses (DazNode, DazMaterial, etc.) returned by DazScene and related helpers instead.

Parameters:
  • client (DazClient) – The DazClient used for all remote calls.

  • locator (str) – A JavaScript expression that evaluates to the underlying DzElement instance inside DAZ Studio.

get_property(label)[source]

Return the current value of a property looked up by its display label.

Parameters:

label (str) – The getLabel() string of the DzProperty.

Returns:

The property value, or None if the property does not exist.

Return type:

object

set_property(label, value)[source]

Set a property value by display label.

Parameters:
  • label (str) – The getLabel() string of the DzProperty.

  • value (object) – The new value. Must be JSON-serialisable.

list_properties()[source]

Return metadata for every property on this element.

Returns:

A list of dicts, each with keys "label", "name", and "type" (the DazScript class name of the property).

Return type:

list[dict]

snapshot(fields)[source]

Read and cache a set of property values in a single call.

Parameters:

fields (list[str]) – Property labels to read.

Returns:

A dict mapping each label to its current value.

Return type:

dict

refresh()[source]

Clear the local property cache so the next read fetches live data.