Skip to content

LightPoseRandomizer ​

LightPoseRandomizer uses the same sampler contract as CameraPoseRandomizer: the callable receives context=scene and returns a location in meters plus XYZ Euler rotation in radians.

python
from telekinesis.illusion.randomizer.randomizer_node import LightPoseRandomizer
from telekinesis.illusion.sampler.camera_pose_sampler import shell_sampler

node = LightPoseRandomizer(
    shell_sampler,
    target_lights=["key"],
    min_distance=0.3,
    max_tries=100,
    radius_min=1.0,
    radius_max=1.5,
    elevation_min=35.0,
    elevation_max=75.0,
)

target_lights=None selects all lights. min_distance is measured from each emitter's enclosing sphere to the visible meshes' world-axis-aligned bounds. Sun lights have no finite position and are exempt from the clearance test. If no valid pose is found within max_tries, the node raises without changing any targeted light pose.

Run this node after object placement and light-property randomization. When physics is enabled, the generator automatically reruns enabled light-pose nodes after objects settle.

Next Steps ​