Light
DazLight
- class dazpy.DazLight(client, identifier)[source]
Bases:
DazNodeProxy for a
DzLightnode.Extends
DazNodewith light-specific properties.- property color: dict | None
Diffuse colour as
{"r", "g", "b"}(0–255 range, read-only).Use
set_color()to change.
dazpy.lighting
Domain-level lighting rigs, built on DazLight and
DazRenderSettings.
- class dazpy.ThreePointLightSetup(target, key=LightSpec(role='key', azimuth_deg=45.0, elevation_deg=30.0, distance=150.0, intensity=100.0, color=(255, 255, 255), position=None), fill=LightSpec(role='fill', azimuth_deg=-45.0, elevation_deg=15.0, distance=150.0, intensity=50.0, color=(255, 255, 255), position=None), rim=LightSpec(role='rim', azimuth_deg=180.0, elevation_deg=45.0, distance=150.0, intensity=75.0, color=(255, 255, 255), position=None), light_type='spot')[source]
Bases:
objectInput spec for a three-point light rig.
- Parameters:
target (Vec3 | DazNode) – The point to light, as a
Vec3world position or aDazNode(itspositionis used).key (LightSpec) – Key light placement/output. Defaults to a 45deg/30deg key light.
fill (LightSpec) – Fill light placement/output. Defaults to a -45deg/15deg fill light.
rim (LightSpec) – Rim light placement/output. Defaults to a 180deg/45deg rim light.
light_type (str) – Forwarded to
create_light()for all three lights — one of"spot","point","distant".
- key: LightSpec = LightSpec(role='key', azimuth_deg=45.0, elevation_deg=30.0, distance=150.0, intensity=100.0, color=(255, 255, 255), position=None)
- fill: LightSpec = LightSpec(role='fill', azimuth_deg=-45.0, elevation_deg=15.0, distance=150.0, intensity=50.0, color=(255, 255, 255), position=None)
- rim: LightSpec = LightSpec(role='rim', azimuth_deg=180.0, elevation_deg=45.0, distance=150.0, intensity=75.0, color=(255, 255, 255), position=None)
- dazpy.apply_three_point_light_setup(scene, setup)[source]
Create and place a key/fill/rim light rig around setup.target.
- Parameters:
setup (ThreePointLightSetup) – The rig configuration.
- Returns:
A
ThreePointLightRigwith handles to the three created lights.- Return type:
ThreePointLightRig
- class dazpy.HDRIEnvironment(image_path, intensity=1.0, rotation_deg=0.0, mode='dome_only', draw_dome=False, resolution=None)[source]
Bases:
objectImage-based (HDRI/dome) lighting configuration.
- Parameters:
image_path (str) – Absolute path to an HDRI/environment map on disk. Must exist – validated by
apply_hdri_environment()before any DazScript call is made.intensity (float) – Passed to the Iray “Environment Intensity” property.
rotation_deg (float) – Passed to the Iray “Dome Rotation” property.
mode (str) – One of
"dome_only","dome_and_scene","scene_only". Maps to the DazScript “Environment Mode” enum. Procedural Sun-Sky mode is intentionally not exposed here.draw_dome (bool) – Whether the dome image is visible as a backdrop in the viewport/render (Iray “Draw Dome”), independent of whether it lights the scene.
resolution (int | None) – Iray “Environment Lighting Resolution” (IBL sampling quality).
Noneleaves DAZ Studio’s current value untouched.
- dazpy.apply_hdri_environment(render_settings, env)[source]
Apply image-based (HDRI/dome) lighting via render_settings.
- Parameters:
render_settings (DazRenderSettings) – A
DazRenderSettings.env (HDRIEnvironment) – The environment configuration.
- Raises:
FileNotFoundError – If
env.image_pathdoes not exist on disk. Checked before any DazScript call is made – an invalid path passed to the underlyingsetMap()call can hang or crash DAZ Studio via a blocking file-not-found dialog.ValueError – If
env.modeis not one of"dome_only","dome_and_scene","scene_only".RenderError – If a post-apply readback of “Environment Intensity” doesn’t match env.intensity. All of this module’s environment writes go through
DazRenderSettings._environment_holder(), which assumesgetRenderElementObjects()[3]is always the Environment property holder – confirmed on one live DAZ Studio 4.x instance only. If that index is wrong on a different DAZ Studio version, every write above silently no-ops (matching the existingif (!holder) return;pattern) with no exception, so this readback is what actually catches it.