View Full Version : Access to collapse utility
02-27-2009, 02:41 PM
simple question... how can I use the Collapse available in the Utilities Tab in my script?
How can I assess that? Maxscript Listener does not print anything when I use it tool and I was not able to find it in the help either. I need to make a script that collapses certain groups of objects and I can't use attach... it creates some artefacts on CAD objects while Collapse works fine.
02-27-2009, 03:53 PM
I may be wrong but I'm pretty sure that you can't. I would like to be shown to be wrong though!
02-27-2009, 07:24 PM
should be some equivalent in code somewhere.. but here's how you could access it via UI commands:
-- open the Collapse utility
-- get UI elements
children = windows.getChildrenHWND (windows.getDesktopHWND())
-- get the "Collapse Selected" button
collapseButton = (for c in children where ( c == "Collapse Selected" ) collect ( c ))
-- your loop-and-selection code goes here
-- after selecting, press the button
02-27-2009, 07:48 PM
I stand corrected!
02-27-2009, 08:52 PM
Richard knows one thing more than the devil! :D
02-27-2009, 09:05 PM
I still think there's a proper code route, but I can't find a thing.
Have you been using the standard Attach() function - and if so, have you considered meshop.attach() / polyop.attach()?
( make sure you disable the undo system when performing these commands, especially in a loop, to boost speed )
What are the problems you are seeing, specifically?
02-27-2009, 09:17 PM
The Edit/Editable object commands (Attach, Detach, etc) invalidate vertex normal information, when dealing with CAD data this is a serious issue. The Collapse utility is the only way to combine objects and retain vertex normal information. I have searched high and low, and AFAIK there is no maxscript access to the Collapse Utility.
02-27-2009, 09:22 PM
ahhh... -that's- what the problem is :o
Okay, then... yep, use the functionality provided above... probably not as efficient as proper code would have been, but it'll get the job done.
02-28-2009, 05:01 PM
Yep... the vertex normals is the actuall problem.
Thanks Richard, I will have a look on the staff you showed.
02-28-2009, 05:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.