[Closed] How to delete all nodes from a layer?
This seems easy on the surface, but I am having a tough time getting access to just the nodes that I want to delete. There are other reference nodes in a layer and I’m not sure if I need to worry about deleting them in addition to any scene nodes. Also, I’m trying to filter by superclass != MaxWrapper and that test just doesn’t work. I can’t get an object that gives its superclass as MaxWrapper to test for it… what gives?
anyone figure this out previously? a script snippet would be much appreciated!
-b
well, i ended up filtering nodes on this layer by what they are, not what they aren’t. so i check for geometry, shapes, lights, and such, and delete those, leaving the maxwrapper objects. it hasn’t caused any problems so far. still, there doesn’t seem to be a straightforward way to take everything in the layer’s nodes array and just delete them, since there is no delete function for maxwrapper objects.
if anyone wants me to package this up (basically a “delete everything on specified layer, now, and possibly delete the layer, all in one step” script) let me know. pm on cgtalk will work.
-b