Page 1 of 1

How to hide a dummy and cuboid grouped with it

Posted: 11 Sep 2021, 11:18
by coder212
I want to get cuboids continuously on a conveyor belt. To do this, I added a cuboid and a dummy. Then grouped that dummy under the cuboid (box). Then in the child script for the conveyor belt, I added a code to copy-paste boxes onto the conveyor belt.

Code: Select all

box = sim.getObjectHandle("Cuboid")
boxDummy = sim.getObjectHandle("BoxDummy")
Copy-pasting objects

Code: Select all

insertedObjects = sim.copyPasteObjects({box,boxDummy},0)
My task is done, the script does exactly what I want it to do but, the initial box I created is there on the floor. Is there a way to hide it or make it invisible?

Re: How to hide a dummy and cuboid grouped with it

Posted: 13 Sep 2021, 07:04
by coppelia

why do you use a dummy and a cuboid instead of a cuboid alone?

To make a shape invisible to the rest of the simulation, you need to do following:
Then, once you have copied the object, appropriately adjust its properties, e.g.

Code: Select all

-- make it visible:
-- make it collidable, measurable and detectable:
-- make it respondable and dynamic:
If you tag your cuboid as model base, then you can enable/disable above properties in the model dialog. Then, programmatically, you can simply do:

Code: Select all

i.e. you would simply remove all model override properties.