Hello, I had a PTSD inducing experience when i spaghettified the stock Astronaut. I’m hoping we can save this guy from future dismemberment.
My goal here was to move him around using a replicator using the following code:
def move_dude():
import omni.replicator.core as rep
with rep.new_layer(name="layer_1"):
usd = 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Samples/Astronaut/Astronaut.usd'
stage = rep.create.from_usd(usd)
astronaut = rep.get.prims(path_pattern='/Replicator/Ref_Xform/Ref/Astronaut')
from omni.kit.viewport.utility import get_active_viewport
viewport = get_active_viewport()
camera_path = '/Replicator/Ref_Xform/Ref/LongView'
viewport.camera_path = camera_path
camera = viewport.get_active_camera()
render_product = rep.create.render_product(camera_path, (2048, 1024))
rep.WriterRegistry.register(WriterTimer)
writer = rep.WriterRegistry.get("WriterTimer")
writer.initialize(output_dir="/home/manifold6/Downloads/test_data/test1", rgb=True, bounding_box_2d_tight=True)
writer.attach([render_product])
frames = 100
with rep.trigger.on_frame(num_frames=frames):
with astronaut:
rep.modify.pose(
position=rep.distribution.uniform(
(-200, 0, -200), (200, 0, 200)
)
)
Here I’m just targeting the higher level xform prim for the purpose to moving the astronaut around randomly. It looks like it’s parent to all the other astronaut related prims.
The strange thing is that it seems to build this graph where it plans to move all the child prims as well as the parent xform which must be why may astronaut is dieing a terrible death.
So the question is. How do i just randomize the values of the parent transform without messing with the children?