Modifying multiple prims in replicator

i have a fence in a scene that is made of two difference prims in my stage. obviously, if i want to randomize the material of the fence, i need both objects to remain visually the same. the following code paints the two prims different colors from each other:

def randomize_fence_color(stage):
    fence = rep.get.prims(semantics=[('class', 'fence')])

    with fence:
        rep.randomizer.color(colors=rep.distribution.choice([(0, 0, 0), (1, 1, 1)]))

    return fence.node

how can i handle modifying multiple objects materials/colors and keeping them consistant?

Hi @danielle.sisserman I’ll put a feature request in for this. Please try the following code snippet:

import omni.replicator.core as rep

with rep.new_layer():

    fence_posts = rep.get.prim_at_path('/World/fences')

    with rep.trigger.on_frame(max_execs=10):
        with fence_posts:
            rep.randomizer.color(colors=rep.distribution.uniform((0, 0, 0), (1, 1, 1)))

This gives me all objects under that path, and colors them the same: