Custom Distribution

Hello,

Can anyone guide me on how I can develop a custom Distribution function ?
I encounter a limit on rep.distribution.sequence. When applied to a replicator item pointing to many prims, it outputs different sample for each prims, instead of affecting the same sample to all prims at each iteration.

For example:

values= [value1, value2, value3,...] #attribute values
prims = rep.get.prims(path_pattern="....")  #fetch many prims, lets say prim1, prim2, prim3

rep.modify.attribute(
       'attribute',
       rep.distribution.sequence(values),
)

will NOT assign value1 to the attribute of all prims at frame1, then value2, then value3, etc.
What it does instead, at the first frame, it will taffect value1 to prim1, value2 to prim2, etc. And if the number of values is not equal to the number of prims, it will raise at exception.

Is there any way to make it work differently? Otherwise can I implement a custom distribution that will sample the same value for all the prims in input_prims (sequentially).

Thanks in advance

1 Like