Randomizer Nodes
SUMMARY
Each randomizer node changes one aspect of the scene: which models are visible, where they are, what they are made of, what is behind them, how they are lit, and where the camera looks. Every node takes its settings as a config from telekinesis.illusion.config and is added to a Randomizer, which runs the nodes in order for every scene.
Import
from telekinesis.illusion import config
from telekinesis.illusion.randomizer.randomizer_node import (
RandomizerNode,
ModelInstanceRandomizer,
ModelPoseRandomizer,
MaterialRandomizer,
BackgroundRandomizer,
LightRandomizer,
LightPoseRandomizer,
CameraPoseRandomizer,
)The Pattern
Every node is built the same way, from its config plus, for some nodes, the names of what it targets:
randomizer.add(
LightRandomizer(config.LightRandomizerConfig(properties={"power": {"min": 20.0, "max": 60.0}}), ["key"]),
"key_light",
)Add nodes in this order, because each one builds on the result of the previous ones: instances → model poses → materials and background → light properties → light poses → camera poses. Light poses keep their distance from the placed models, and the camera aims at the visible models, so both need the models in place first.
How targets are matched
ModelPoseRandomizer matches target_models as instance-name prefixes ("gear" also matches gear_large). MaterialRandomizer matches registered model names or groups exactly. LightRandomizer and LightPoseRandomizer match light names exactly; with no targets they apply to every light.
Nodes
ModelInstanceRandomizer
Samples how many instances of each model are visible in the scene, and reveals them.
View →ModelPoseRandomizer
Places the visible target models with your pose function, rejecting poses that collide.
View →MaterialRandomizer
Assigns a random PBR or procedural material to each target model, by model name or group.
View →BackgroundRandomizer
Picks a registered HDRI by group or name. It is both backdrop and ambient light.
View →CameraPoseRandomizer
Samples one camera pose per view, so a single randomized scene yields several images.
View →LightRandomizer
Samples validated light properties such as color, power, size, and cone angle.
View →LightPoseRandomizer
Samples named light poses with clearance from visible geometry.
View →Custom Nodes
Add any other axis of variation by subclassing RandomizerNode and implementing randomize().
View →