How to generate spheres in first trigger, and cube in second trigger?
How to use rep.modify.register
API?
The Scenario I met was I want to delete the specific replicatorItem and generate a new one in different trigger, Thanks!!
def randomize_spheres():
spheres = rep.create.sphere(
position= rep.distribution.uniform((0,0,0), (2, 2, 2)),
scale=0.1,
count=2)
return spheres.node
rep.randomizer.register(randomize_spheres)
def randomize_cube():
cube = rep.create.cube(
position= rep.distribution.uniform((0,0,0), (2, 2, 2)),
scale=0.1,
count=2)
return cube.node
rep.randomizer.register(randomize_cube)
with rep.trigger.on_time(num=2,interval=5):
with camera:
rep.modify.pose(
position = (2, 2, 50),
scale = (1, 1, 1),
)
spheres = rep.randomizer.randomize_spheres()
with spheres:
rep.modify.pose(
rotation = rep.distribution.uniform((0,0,0), (2, 2, 2)),
)
# rep.modify.register(
# randomize_cube,
# override=True)