Render Settings

class dazpy.DazRenderSettings(client=None)[source]

Bases: object

is_available()[source]

Return True if the render manager is accessible.

is_rendering()[source]

Return True if a render is currently in progress.

render_engine_state()[source]

Return truthful Render Settings engine facts and a normalized verdict.

DzRenderOptions.renderType is the effective render-operation selector. The active renderer class/name is returned as a separate fact and only participates in normalization when renderType is Software. In particular, an Iray active-renderer name cannot turn a ScreenShot or HardwareAssisted operation into an Iray verdict.

set_render_engine(engine)[source]

Persist iray or viewport and require exact live readback.

This is an explicit persistent setter, not a transactional render helper. It calls applyChanges() so the selected render operation is written via DAZ’s settings manager. Any lookup, mutation, apply, or readback failure raises RenderError; unknown engine names never silently continue.

active_engine()[source]

Return the active render engine name.

The Render Settings pane’s “Engine” dropdown conflates two separate DazScript concepts, confirmed against a live instance: DzRenderOptions.renderType is a 3-value enum (ScreenShot, HardwareAssisted, Software) picking how the scene is rendered; only when it’s Software does renderMgr.getActiveRenderer() (the pluggable Iray/Filament/… renderer) apply. Returns "viewport" or "multi_pass_opengl" for the first two modes, otherwise the mapped engine name (e.g. “iray”, “filament”), falling back to the raw DazScript class name (e.g. “DzIrayRenderer”) if it isn’t one of the known engines.

set_active_engine(engine)[source]

Set the active render engine.

Parameters:

engine (str) – "viewport" or "multi_pass_opengl" to switch DzRenderOptions.renderType to one of the two non-pluggable modes, or a pluggable renderer name (e.g. "iray", "filament", or a raw DazScript class name like "DzIrayRenderer") to set renderType to Software and activate that renderer.

Raises:

RenderError – If a pluggable renderer name doesn’t resolve to a renderer registered with the render manager (e.g. the Filament plugin isn’t installed).

property resolution: dict | None

Return the render image size as {{width, height}}.

set_resolution(width, height)[source]

Set the render image size in pixels.

property output_path: str | None

Return the filename set for rendered images.

property gamma: float | None

Return the gamma correction value.

property double_sided: bool | None

Return whether polygons are rendered as double-sided.

render(camera_name=None, camera_label=None)[source]

Render the scene to output_path.

DAZ Studio’s doRender() only writes to disk when renderImgToId is set to DzRenderOptions.DirectToFile and the camera is applied to both the render options and the active viewport before the call.

Parameters:
  • camera_name (str | None) – Internal name of the camera node to render from. Internal names are not guaranteed unique – e.g. duplicating a camera node in the Scene panel copies its internal name too, only the display label is forced unique – so this can silently resolve to the wrong node when duplicates exist. Prefer camera_label unless you specifically need name-based lookup. Mutually exclusive with camera_label.

  • camera_label (str | None) – User-visible label of the camera node to render from (the same value shown in the Scene panel, resolved via Scene.findCameraByLabel()). Labels are kept unique by DAZ Studio even when internal names collide, so this is the more reliable way to target a specific camera. Mutually exclusive with camera_name. When neither is given the active viewport camera is used.

Returns:

A RenderOutcome with success and the resolved output_path actually written by doRender() (opts.renderImgFilename after the call).

Raises:

ValueError – If both camera_name and camera_label are given.

Return type:

RenderOutcome

render_and_wait(poll_interval=1.0, timeout=600.0)[source]

Alias for render() kept for backwards compatibility.

doRender() is synchronous in DAZ Studio so no polling is required.

has_render()[source]

Return True if there is a completed render available to save.

property max_samples: int | None

Iray progressive rendering sample cap (Max Samples in the Advanced tab).

property max_time_secs: int | None

Iray progressive rendering time cap in seconds (Max Time in the Advanced tab).

property quality: float | None

Iray Rendering Quality convergence target (higher converges further).

set_quality_preset(preset)[source]

Apply a named Iray quality preset, controlling sample count and render time.

Parameters:

preset (str) – One of "draft", "preview", "good", "final" (fastest/lowest quality to slowest/highest quality).

Raises:

ValueError – If preset is not a recognized preset name.

property canvases_enabled: bool | None

Master on/off switch for all Iray Canvas output (Render to Canvases).

list_canvases()[source]

List the Iray Canvases currently configured on the active render.

add_canvas(name, canvas_type)[source]

Add (or reconfigure) an Iray Canvas by name.

Parameters:
  • name (str) – Canvas name. If a canvas with this name already exists it is reconfigured to canvas_type rather than duplicated.

  • canvas_type (str) – One of "Beauty", "Diffuse", "Specular", "Glossy", "Emission", "LightGroup", "EnvironmentLighting", "LPE", "Irradiance", "Alpha", "Shadow", "AmbientOcclusion", "Distance", "Depth", "MaterialTag", "MaterialID", "ObjectID", "Normal", "TextureCoordinate", "BSDFWeight", "ConvergenceHeatmap", "PostToon", "WorldPosition".

Returns:

The resulting Canvas.

Raises:

RenderError – If the render manager or Iray property holder is unavailable.

Return type:

Canvas

remove_canvas(name)[source]

Remove a configured Iray Canvas by name.

Returns:

True if a matching canvas was found and removed, False if no canvas with name exists.

Return type:

bool

canvas_output_paths(output_path)[source]

Return each configured canvas’s resolved output file path for a render to output_path.

Derived from DAZ Studio’s naming convention – canvases are written to <dir>/<basename>_canvases/<basename>-<canvasName>-<canvasType>.exr alongside the main render output. Confirmed empirically against a live render; DazScript does not expose these paths directly, so this is computed rather than queried.

Parameters:

output_path (str) – The path passed as the main render’s output_path (i.e. what output_path would be set to).

Returns:

A dict mapping each canvas’s name to its resolved output path.

Return type:

dict[str, str]