Hello,
I have a bunch of objects in the hierarchy, how can I delete them at once by click or scripts?
Thank you!
How to delete a bunch of objects at once?
Re: How to delete a bunch of objects at once?
Hello,
you can shift-select objects in the scene hierarchy then click <delete>.
Programmatically, you can use
Cheers
you can shift-select objects in the scene hierarchy then click <delete>.
Programmatically, you can use
sim.removeObject
or sim.removeModel
in various ways, e.g.Code: Select all
sim.removeObject(objectHandle) -- remove a single object
sim.removeModel(modelHandle) -- remove a single model
sim.removeObject(sim.handle_all) -- remove all objects
-- Remove a list of objects, e.g. the objects that originate at the hierarchy tree of "myRobot":
local baseHandle=sim.getObjectHandle("myRobot")
local objectList=sim.getObjectsInTree(baseHandle)
for i=1,#objectList,1 do
sim.removeObject(objectList[i])
end