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:
- hierarchy(max_depth=None)[source]
Return the descendant tree under this node, in one call.
- Parameters:
max_depth (int | None) – Levels to include below this node (this node is level 0).
Noneor0means unlimited.- Returns:
{"node": label, "hierarchy": {...}, "total_descendants": int}, each entry{"label", "name", "type", "element_id", "children"}(childrenomitted on leaves).total_descendantscounts the children visited, including those at the depth limit.- Raises:
NodeNotFoundError – If this node is not in the scene.
- Return type:
- unparent(*, preserve_world_transform=True)[source]
Detach this node from its parent so it sits at the scene root.
A no-op for a node that is already at the root.
- Parameters:
preserve_world_transform (bool) – Keep the node’s world-space transform (default), adjusting its local values;
Falsekeeps the local values, which may move it in world space.- Raises:
ScriptRuntimeError – If Studio refuses the detach.
- 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:
- 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
- resolve_material(ref)[source]
Find a surface zone by label, then by internal name.
- Raises:
NodeNotFoundError – If this node is not in the scene.
MaterialError – If the node has no surfaces or no zone matches; the message lists the available zone labels.
- apply_surface_preset(path, *, map_paths=None, allow_missing=False)[source]
Apply a material or shader preset
.dufto every surface of this node.Selects this node alone and every one of its surfaces (preset application acts on the selected surfaces; with only the node selected
openFilereports success and changes nothing), then opens the preset through the content manager.- Parameters:
path (str) – Absolute path to the preset file.
map_paths (Sequence[str] | None) – Texture paths the preset references (absolute or content-relative). Checked first: if any is missing the preset is not opened, because Studio’s Missing Files dialog would block the script server.
allow_missing (bool) – Open the preset even when maps are missing.
- Returns:
MaterialInfofor every surface after the preset applied.- Raises:
NodeNotFoundError – If this node is not in the scene.
MaterialError – If maps are missing, or Studio fails to open the preset.
- Return type:
list[MaterialInfo]
- 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
- property element_id: int | None
Studio’s unique
elementIDfor this node (Noneif not in the scene).NodeIdentifier(str(node.element_id), kind="element_id")addresses the node unambiguously even when labels repeat.
- describe()[source]
Return this node’s label, name, type, elementID, parent and child count.
- Raises:
NodeNotFoundError – If this node is not in the scene.
- numeric_properties(include_modifiers=False)[source]
Every numeric property on the node, in one call:
{label: value}.- Parameters:
include_modifiers (bool) – Also collect the object’s modifier stack (morph value channels and modifier properties), where most of a figure’s dials live. A property reached twice is reported once; when two properties share a label, the first in search order (node, then modifiers) wins. (Morph value channels are all named
Value, so labels are the only usable key.) DefaultFalsekeepsDazElement.numeric_properties()’ node-only behaviour.- Returns:
{label: value}, or{}if the node is not in the scene.- Return type:
- set_numeric_property(name, value, *, substring_fallback=False, unlock=True)[source]
Set a numeric property found by label or name, searching modifiers too.
Searches node-level properties, then each modifier (a morph matched by its own name or label resolves to its value channel) and the modifier’s properties, matching label or name exactly (case-insensitive). With substring_fallback, a second pass accepts the first property whose label or name contains name.
- Parameters:
- Returns:
NumericPropertyWritewith the matched label, the name (the morph’s name when matched through a morph, since its value channel is always calledValue) and the value read back.- Raises:
NodeNotFoundError – If this node is not in the scene.
PropertyNotFoundError – If no property matches.
TypeError – If the match is not numeric.
- Return type:
NumericPropertyWrite
- property_details(kind='all')[source]
Node-level properties with type, value, range, default, group path and animatability, in one call.
- Parameters:
kind (str) –
"all","numeric","transform"(translate, rotate and scale channels),"morph"(numeric, not a transform),"bool"or"string".- Raises:
ValueError – For any other kind.
- property_detail(name)[source]
Metadata for one node-level property, by label or name (case-insensitive).
- Raises:
NodeNotFoundError – If this node is not in the scene.
PropertyNotFoundError – If no node-level property matches.
- find_numeric_property(name)[source]
Return the numeric property whose label or name is name (case-insensitive).
Searches like
set_numeric_property()(node properties, then the modifier stack), exact matches only. The proxy re-finds the property by the same rule on every call.- Raises:
PropertyNotFoundError – If nothing matches, or the match is not numeric.
- morph_info(pattern=None, include_zero=False)[source]
List the node’s
DzMorphmodifiers with label, value and group path.- Parameters:
- Returns:
MorphInfoper matching morph ([]if the node has no object or is not in the scene).- Return type:
list[MorphInfo]
- set_numeric_candidates(slots)[source]
Set numeric dials chosen from per-slot candidate names, in one call.
Each slot is
(candidate_names, value). The first candidate that resolves on this node is set to value and read back; later candidates in that slot are ignored. This handles dials whose names differ between figure generations or products, e.g. a smile that is"Smile"on Genesis 9 but something else on another figure.A name resolves, in order, as a node-level property name (
findProperty: expression and pose controller dials), then a node-level property label, then aDzMorphmodifier name or label (its value channel). Only numeric properties count.Writes use plain
setValue(), likeset_property().- Parameters:
slots (Sequence[tuple[Sequence[str], float]]) –
[(names, value), ...]. names must be a sequence of strings, not a bare string.- Returns:
One
NumericCandidateMatchper slot, in order.- Raises:
TypeError – If a slot’s names is a bare string.
NodeNotFoundError – If this node is not in the scene.
- Return type:
list[NumericCandidateMatch]
- key_numeric_candidates(slots)[source]
Keyframe dials chosen from per-slot candidate names, in one call.
Like
set_numeric_candidates(), but each slot carries[(frame, value), ...]keys instead of one value; frames convert to DzTime withScene.getTimeStep(). The returned matches havevalueNone.
- load_morph(obj_path, *, control_node=None, **options)[source]
Create a morph on this node from an OBJ with Morph Loader Pro.
- Parameters:
obj_path (str) – The OBJ to load (on the Studio host).
control_node (DazNode | None) – Node owning
control_property_name(default: this node).**options (Any) – Morph Loader Pro settings in snake_case:
morph_name,load_mode("EntireFigure","SelectedNodes","PrimaryNode","SingleSkinFigure","SingleSkinFigureFromGraft"),overwrite_mode("MakeUnique","DeltasAndERCLinks","DeltasOnly"),mirroring,scale,delta_tolerance,subdivision,subdivision_mapping,reverse_deformations,reverse_deformations_pose_path,control_property_name,control_property_erc_type,property_group_path, … (seedazpy/_morph_loader.pyfor the full list).reverse_deformations_pose_pathmust be an existing absolute file path on the Studio machine (checked before loading, since a missing file pops blocking dialogs); omit it to use the current scene pose.
- Raises:
DazError – If the plugin is missing or the loader reports a problem.
- save_support_asset(output_path, *, vendor='Author', product='Product', item=None, category=None, compatibility_base=None, compatible_with=None, smart_parent=None, write_geometry=None, write_parameters=None, write_uvs=None, force_unique_ids=None, compress=None)[source]
Save this node as a support asset (
DzNodeSupportAssetFilter), silently.output_path must be inside a configured content directory.
- Returns:
The content directory the asset was saved under.
- Raises:
ValueError – If output_path is outside every content directory.
DazError – If the filter is unavailable or the save fails.
- Return type:
- 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.
- set_transform_key_interpolation(frames, kinds, *, rotation=True, fast_start=False, fast_end=False)[source]
Set how Studio interpolates this node’s position (and rotation) keys.
Low-level;
KeyframedeasingandCameraKeyframeinterpolationbuild the arguments for a camera move.kinds[k]sets the segment from the key atframes[k]to the next key in frames, on every X/Y/Z position control (and rotation control when rotation):"linear": straight line (DzProperty.InterpLinear)."constant": hold, then jump (InterpConstant)."smooth": Studio’s default curve (InterpTCB, tension, continuity and bias 0): Catmull-Rom tangents at interior keys, zero at the first and last key."hermite":InterpHermitewith the same Catmull-Rom tangents computed per control, except at an end flagged fast_start / fast_end, whose tangent is the quadratic one (2*slope - tangent at the other end of the segment) clamped to between the segment’s average slope and three times it, so the move neither stops there nor reverses. A two-key move with fast_end is exactlyt**2(ease in); with fast_start,2t - t**2(ease out).None: leave the key as it is.
Tangents use only the keys in frames. Keys missing on a control are skipped; the last key’s kind affects nothing after it.
- Parameters:
- Raises:
ValueError – Lengths differ, frames are not strictly ascending, or a kind is unknown.
- 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
- subdivision()[source]
SubD levels of this node’s mesh:
{"view": int, "render": int}.These are the shape’s “View SubD Level” (
SubDIALevel) and “Render SubD Level (Minimum)” (SubDRenderLevel) dials;Nonevalues mean the mesh has no SubD cage.
- set_subdivision(view, render=None)[source]
Set the mesh’s view SubD level (and optionally its render minimum).
- Returns:
{"previous": {...}, "current": {...}}levels as insubdivision().- Raises:
NodeNotFoundError – If this node is not in the scene.
PropertyNotFoundError – If the mesh has no SubD levels.
- Return type:
- add_dforce_dynamic_surface()[source]
Add a dForce Dynamic Surface modifier (Studio’s own action, run on this node alone).
- dforce_influence_weights()[source]
Per-vertex dForce influence weights (0 = pinned, 1 = free), or
Nonewhen the modifier has no weight map yet.
- set_dforce_influence_weights(default=1.0, overrides=None)[source]
Set every vertex’s dForce influence to default, then overrides.
- set_dforce_property(name, value)[source]
Set a property on this node’s dForce modifier (by name or label, case-insensitive). Returns modifier, property, old_value, new_value.
- Raises:
PropertyNotFoundError – Lists the modifier’s property names.
- dforce_surface_properties(material=None)[source]
dForce simulation settings of one surface (default: the first).
- set_dforce_surface_property(name, value, material=None)[source]
Set one numeric dForce surface setting. Returns material, property, old_value, new_value.
- Raises:
PropertyNotFoundError – Lists the surface’s setting names.
- freeze_dforce(on=True)[source]
Freeze (bake) or release every dForce modifier on this node.
Freezing holds the simulated shape on the mesh – Studio’s dForce “bake”. Returns how many modifiers were changed.
- fitted_item_info()[source]
Items fitted to this figure, with their kind, in one call.
A node counts as fitted if it follows this node (conforming clothing and hair) or is a direct non-bone child of it (props and accessories).
typeis"hair"forDzHairnodes, otherwise"clothing"for followers and"prop"for children.
- fitted_items()[source]
Proxies for the items fitted to this figure (see
fitted_item_info()).Bound by elementID. Bones are not fitted items (a figure’s root bone is its direct child).
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").