Skip to content

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 ​

python
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:

python
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 ​

Next Steps ​