Remove the unused 'nodes' in Max

Is there a way to see all the hidden nodes(class instances) in Max, and remove them gracefully?

When dealing with some max scenes, they used a certain of unknown in-house written max plugins, which leads to the annoying reminder every time when the scene is opened via a machine without that plugin installed.

Like in maya we can simply save it as the ascii file and delete that node there, but since max is a proprietary binary format, is there any similar tool to safely clean out(let you choose what to get rid of) the scene?

It’s easy if you know how to identify the undesirable objects. Are they literally just all the hidden ones in the scene? If so, the MaxScript would be something like this:

for obj in objects do
   if obj.isHidden then
      delete obj

… but I’m guessing it’s not literally hidden objects you’re after?

neh, as you guess that won’t work.
Can’t even see them in the Schematic View. :(:

What I meant ‘hidden’ here is these nodes are already injected into the scene, and there must some ways to get rid of…

If they’re of a custom class (or any class for that matter) you can delete them via max script…


for object in objects where (classOf object) == custom_class do
(
   delete object
)

Replace custom_class with the name of the actual class you’re after.

hmm, this should work.
will give it a try tomorrow.

That probably won’t work either, you’ll be looking for missing object classes. There is a script posted over at cgtalk that can deal with this, if I’m correct.

-Johan

You can find and delete the missing objects in a hacky sort of way with something like the following:

for obj in objects do 
(
	if ((classOf obj) as string ) == "Missing_GeomObject" then delete obj;
)

How could I collect all the ‘objects’ in scene?

Objects is a virtual array of the objects in the scene. There are several such arrays: Geometry, Lights, sceneMaterials, etc.

wow that’s fast…
gotcha.