Skip to content

BackgroundRandomizer

Samples an HDRI background, which also drives the scene lighting.

python
from telekinesis.illusion.randomizer.randomizer_node import BackgroundRandomizer

BackgroundRandomizer(
    hdris_root=None,   # directory holding the HDRIs
    categories=None,   # HDRI categories to sample from
)

Parameters

ParameterTypeDescription
hdris_rootPath | NoneRoot directory of the HDRI assets. None uses the hdris/ sub-directory of the resolved asset directory.
categorieslist[str] | NoneCategories to sample from. None samples from every category.

Available categories:

CategoryDescription
indoor/industrialFactory and workshop environments.
indoor/studioNeutral studio lighting.
indoor/miscOther indoor environments.
outdoor/dayDaylight.
outdoor/morningMorning light.
outdoor/eveningEvening light.
outdoor/nightNight.

The catalog is built when the node is constructed. A FileNotFoundError is raised when no HDRI matches the requested categories.

Usage

python
randomizer.add_randomizer(
    randomizer_node=BackgroundRandomizer(
        categories=["indoor/industrial", "indoor/studio"]
    ),
    node_name="background_randomizer",
)

Next Steps