QuickCollapse.ms
by Dave Buchhofer on Mar.16, 2009, under Batching, maxscript
Here’s partial results from last nights maxscript silliness.
QuickCollapse is a maxscript Struct with a few functions to speed up collapsing large numbers of objects, it provides feedback in the listener window so you can see progress as it goes.
Run script will trigger ‘CollapseSelected’ on your current selection. there isn’t much Error Checking involved, so filter your selection for meshes, and remeber that it SHUTS UNDO OFF for the collapse so that we dont have RAM overruns on large objectsets, so save/hold first eh?












March 20th, 2009 on 9:58 pm
Is there supposed to be a readout screen while this is running?
I’m totally new to this, so forgive me if this is a dumb question. But I’m looking through the script and it seems like there’s a % done type thing. But when I run the script it doesn’t show anything?
March 20th, 2009 on 10:05 pm
Okay, sorry, I already figured it out — The Listener.
Thanks, this script is exactly what I was looking for.
March 20th, 2009 on 11:08 pm
Sorry, another question.
I was looking through the script and was wondering if there is a way for me to change it to Collapse w/ boolean union? Like in the Collapse utility?
March 20th, 2009 on 11:34 pm
Sure that could be done, i believe the only change would be instead of meshop.attach, it would be mesh1 + mesh2
QuickCollapse-union.ms
can’t really test it out from home, but give it a try and let me know if it works!
from the help:
mesh + mesh — union
mesh – mesh — difference
mesh * mesh — intersection
March 21st, 2009 on 12:01 am
hmm, the quickcollapse union doesn’t seem to have any changes? I’m trying to figure the syntax. I see the mesg + mesh your talking about and the meshop.attach. I just haven’t figured out how to replace it…
March 21st, 2009 on 12:06 am
Got it.
Thanks, you’ve been a big help! It does work.
( b + arr[i] ) instead of ( meshop.attach b arr[i] )
Thanks again!
March 21st, 2009 on 2:04 am
Strange, after running this script, I can’t save. It keeps freezing when I try to save. This last time I fiddled with the object a bit before trying to save. The fiddling went fine? I did notice, that the objects were not deleted, I had 1000 spheres to start, then at the end I still had those thousand spheres + like 32 objects(from the first pass) and another like 9 objects, and then the one big one. I tried deleting the other objects and I have what I want – just can’t save it ??
March 21st, 2009 on 2:21 am
that’s a new one to me, I’ve yet to run into any issues saving. I haven’t had a change to try out the union version though, maybe you can sidestep the issue by exporting instead? or possibly try the Reset Xform, Convert to Mesh tricks.
March 21st, 2009 on 5:05 am
Okay, it was a personal problem
It was trying to save through the network instead of directly to the hard drive.
Everything looks to work perfectly – now if I can figure out what to add to delete all the originals automatically.
Thanks
February 5th, 2010 on 2:20 pm
Just ran this script with Max2010 and got an error. It’s opening the script in the editor and highlighting the line “meshop.attach b arr[index]” Any ideas?
Is it possible to modify your script to automatically go through a max file and automatically collapse by layer? It would make the transition between Revit and Max a little less painful.
February 5th, 2010 on 3:32 pm
Bruce, hi, yea, that was exactly the impetus for making it, This is the ‘generic’ library that i load into various other scripts, my collapse by layer script simply selects all objects on a layer, then runs this!
I’ve found most of the errors that pop up are due to the lack of error checking for various things that aren’t easily collapsed to Editable Meshes, Dummys, Cameras, helpers, group heads, etc.
I’ve since expanded this to an interface with various other helper scripts for general mesh cleanup (Weld all, Delete isolated verts, collapse to individual meshes, collapse to 1 mesh, collapse by layer, etc.)
Someday soon I hope to clean it up and package it somewhat. I really only haven’t thus far since it includes a few parts of other peoples useful scripts and i haven’t taken the time to check with them yet.
February 5th, 2010 on 3:33 pm
an eaaasy/quick way to filter out the un-collapseable objects, is to shut them off by category with the Display Floater
February 17th, 2010 on 10:57 pm
Dave, thanks so much for the quick response. I got caught up in a project and only just now had the opportunity to check back. So I’m getting the error ’cause I’ve got non-collapsible elements selected – makes sense. Does that include those invisible objects that come in when you import a model from Revit? Is that what you mean by group heads? My process now is to manually select by layer, run the collapse utility, then turn off the object and delete all the invisible stuff left over. Sounds like you’ve got this whole process w/ geometry cleaning already automated. I’d like to write a similar script but I’m just getting started with maxscript. Any tips would be greatly appreciated and thanks for all your help so far!
February 19th, 2010 on 1:42 pm
My scene geometry is coming from Revit by way of DWG. Each object is written out as an Acad block and comes into 3dsMax as a mesh object linked to an empty parent object.
I tried to filter my selection with both the display floater and the selection filter but both of them include the empty parent object and that’s what seems to cause the error. How do you work around this?
January 1st, 2012 on 10:19 am
hi, i want to use your script.. i’m a nurbs modeller and use body objects and nurbs.
well could you add the ability to collapse such kind to their own kind instead to convert them to editable mesh?
also how to collapse them all without to join or grouping them all?
thank you and happy new year