Hi!
I’m trying to simulate different layouts of cases on a pallet and I’m using the replicator to toggle the visibility of cases. The cases I use have to have a collision for other parts of the simulation I’m doing, but I’d like to turn the collision off when the case is invisible. This is the code I’m currently working with:
def case_visibility_randomizer(self):
omni.log.info(f"Randomize case visibility")
case_pattern = r"/World/Pallets/Pallet_0/Layer_\d+/Case_\d+/"
cases = rep.get.prims(path_pattern=case_pattern, prim_types="Mesh")
with cases:
rep.modify.visibility(rep.distribution.sequence([True, False]))
rep.modify.attribute("physics:collisionEnabled", rep.distribution.sequence([True, False]))
return cases.node
If I try to change the attribute as shown in the code I get the following error:
2025-03-18 13:48:33 [47,272ms] [Error] [omni.graph.core.plugin] /Replicator/SDGPipeline/WritePrimAttribute_physics_collisionEnabled: [/Replicator/SDGPipeline] OmniGraph Error: WritePrimAttribute Error: cannot reshape array of size 1 into shape (60,newaxis)
(from compute() at line 236 in /home/developer/.local/share/ov/pkg/isaac-sim-4.2.0/extscache/omni.replicator.core-1.11.20+106.1.0.lx64.r.cp310/omni/replicator/core/ogn/python/_impl/nodes/OgnWritePrimAttribute.py)
[35.910s] [Level.ERROR] [None] [Node.cpp:1860] : /Replicator/SDGPipeline/WritePrimAttribute_physics_collisionEnabled: [/Replicator/SDGPipeline] OmniGraph Error: WritePrimAttribute Error: cannot reshape array of size 1 into shape (60,newaxis)
(from compute() at line 236 in /home/developer/.local/share/ov/pkg/isaac-sim-4.2.0/extscache/omni.replicator.core-1.11.20+106.1.0.lx64.r.cp310/omni/replicator/core/ogn/python/_impl/nodes/OgnWritePrimAttribute.py)
Is there any way to turn the collider off, ideally directly linked to the visibility parameter of each case?
Thank you in advance for any input!