Spaghettifing the Astronaut

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?

1 Like

Hello, I would also like to know the solution when you find out.

1 Like

Having consistent problems working with rigs similar to this.

+1 on guidance on this

Additional info here. The astronaut can be moved around in Code using the built in manipulator at that prim level without issue. See images below:

Could anyone give me a hand with this?

Bump Bump, Thump Thump

Any chance I could get a hand?

It seems the issue was with how I was creating the replicator object. I needed to rep.rep.get.prim_at_path('/Replicator/Ref_Xform/Ref/Astronaut') instead of astronaut = rep.get.prims(path_pattern='/Replicator/Ref_Xform/Ref/Astronaut')

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.