Properties

class dazpy.DazProperty(client, owner_locator, property_label)[source]

Bases: DazElement

Proxy for a DzProperty on any DzElement.

Provides typed read/write access to a single named property, including keyframe support for animated properties.

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

  • owner_locator (str) – JavaScript expression that evaluates to the owning DzElement.

  • property_label (str) – The getLabel() string of the property.

property value: object

Current property value (read/write).

property raw_value: object

This property’s own dial value, excluding any DzERCLink contributions.

A property driven by one or more DzERCLink controllers (for example a character’s “Scale” dial fed by dozens of linked morphs) computes value as raw_value plus every controller’s contribution. Reading and writing value in a save/restore round trip is therefore not idempotent for such properties: the captured (post-ERC) total gets written back into the raw slot on restore, and the ERC links add their contribution again on top, inflating the property a little more on every cycle.

Use raw_value instead of value whenever you need a snapshot/restore round trip to be exact — it reads and writes only the property’s own baseline and is unaffected by ERC links either way. For properties without ERC links, raw_value and value are identical. Falls back to value for property types that don’t expose a raw accessor (e.g. non-numeric properties).

property label: str | None

The display label of this property (read-only).

property min: float | None

Minimum allowed value (read-only; None if not applicable).

property max: float | None

Maximum allowed value (read-only; None if not applicable).

set_key(time, value)[source]

Set a keyframe for this (numeric) property.

Writes via DzNumericProperty.setDoubleValue(tm, val) — the DazScript keyframe surface confirmed live against a running DAZ Studio instance (see dazpy.cinematics.apply_animated_shot, which uses the same call). DzProperty.setKey()/addKey(), which earlier versions of this method called, do not exist on a live property and silently wrote nothing.

Parameters:
  • time (float) – The keyframe time in DAZ ticks.

  • value (float) – The numeric property value at that keyframe. Non-numeric properties (color, string, enum, …) are not supported — this is a no-op for a property without setDoubleValue.

property is_animated: bool | None

True if this property has keyframe animation data (read-only).

Implemented as getNumKeys() > 0DzProperty.isAnimated(), which this property called previously, does not exist on a live property and raised a ScriptRuntimeError on every access.

get_keys()[source]

List all keyframes on this property’s animation curve.

Returns:

A list of {"time": float, "value": object} dicts, one per keyframe, ordered by time. Empty list if the property has no keys or doesn’t support keyframing.

Return type:

list[dict]

remove_key(time)[source]

Remove a single keyframe at the given time.

Parameters:

time (float) – The keyframe time in DAZ ticks. If no key exists at exactly this time, this is a no-op.

clear_keys()[source]

Remove all keyframes from this property’s animation curve.