I would like to randomize between different sets of parameters. So for example, for each background I have a corresponding light settings I would like to use. Unfortunately I have not been able to achieve this since the distributions don’t support dictionaries and you can’t use generated indexes to access parameters.
Here is the pseudo code of what I am trying to achieve
The way to do this is to pre-generate your list of parameters, and then use them later in a replicator distribution.
Example:
import omni.replicator.core as rep
import random # Python random library
NUM_RANDOM = 10
random_list = [ random.randint(1, 10) for _ in range(NUM_RANDOM)]
with rep.trigger.on_frame(max_execs=10):
sphere = rep.randomizer.instantiate(paths="omniverse://localhost/NVIDIA/Samples/Marbles/assets/standalone/A_marble/A_marble.usd",
size=rep.distribution.sequence(random_list),
use_cache=False)
By using the pre-generated random_list in rep.distribution.sequence I can instantiate a “random” number of marbles each frame.
distribution.sequence and distribution.choice can both take pre-generated lists of values.
By using distribution.sequence you can “group” different lists of parameters, since it will iterate through each of them in sequence (like what you are doing with idx.