How to set visibility of a Prim?

Hello,

how can I set the visibility of a Prim in Python?

If I try this:

def setup_scene(self):
    self._world: World = self.get_world()
    self._world.scene.add_default_ground_plane()

    self._thing: Prim = add_reference_to_stage(usd_path=assets_path+thing_path, prim_path="/World/thing")
    return

async def setup_post_load(self):
        
        self._world.add_physics_callback("sending_actions", callback_fn=self.main_loop)
        
        return

def main_loop(self, step_size):
        
        self._thing.SetHidden(True)
        return

I get the Error:
[Error] [carb.physx.python] AttributeError: ‘XXX’ object has no attribute ‘_thing’

But when I cange my code to:

def main_loop(self, step_size):
        
        print(self._thing)
        return

it works.

Why is there this Error and how can I control the visibility?

Thank you

@spara.sprachinerv i am just a fellow user and thought this might be somewhat relevant:

This way worked for me:

Thanks @Simplychenable

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