Maxunderground news unavailable
|Detach Poly sub elements|
Hi there, I need to detach many sub elements from a edit poly modifier, but, if I select them all it detaches to a single object, if I select one by one It will take hours of working. How can I detach them all to single objects without losing much time?
read 1157 times
4/28/2008 9:47:19 PM (last edit: 4/28/2008 9:47:19 PM)
Convert it to an editable mesh, go into element mode, select everything, scroll down the modify panel to 'Explode', enter a value of 180 in the spinner box, adn click the Explode button, et voila!
read 1132 times
4/29/2008 2:38:06 AM (last edit: 4/29/2008 2:38:06 AM)
If you have an Editable Poly object selected and run this script, it should remove all of the elements out as separate objects. The original poly containing them will be destroyed in the process.
To run the script open a new script window and copy/paste the code below into it and press Ctrl-e
polyObj=$ -- Editable poly to break apart
polyop.setFaceSelection polyObj #all -- set all of it's faces to selected
--Max functions stored to variables for faster lookup later
-- Give each new element object name of original poly appended with "_Element" and number from NameIncr
while (polygetNumFaces polyObj)>0 do (--While there are still faces left in original poly
polyFaces=polygetFaceSelection polyObj -- get faces left in poly as bit array
loopFlag=true -- set loop flag to true
nameIncr+=1 -- increment naming number for new element object
newObjName=polyObjName+ nameIncr as string -- create name for new element object
for face in polyFaces while loopFlag do (--get face index in bit array (will only use the first one retrieved for each loop)
elementFaces=polygetElementsUsingFace polyObj face -- get faces associated with element in poly containing the retrieved face
elementVertices=polygetVertsUsingFace polyObj elementFaces -- get vertices associated with the stored faces
polydetachVerts polyObj elementVertices name:newObjName asNode: true -- detach/name element as seperate object containing the vertices
loopFlag=false -- break out of for loop, only needed first face index in bit array
newObj=getNodeByName newObjName ignoreCase:false -- get the newly created object from poly element
newObj.pivot=newObj.center -- center it's pivot point
polySetFaceFlags newObj #all 0 mask: 1 -- clear face selection flags from it
delete polyObj -- delete the original poly object (is now an empty poly object after all of it's elements have been removed)
read 1119 times
4/29/2008 4:29:34 AM (last edit: 4/29/2008 4:36:47 AM)
Nice script, Id just like to add that the object needs to be an editable poly object at base level, i.e. not an edit poly modifier, as then it just deletes everything. Nice ;)
(does seem a lot of work to have made for what edit mesh can do already though :p plus you can do it with an edit mesh modifier, but both ways work well)
read 1111 times
4/29/2008 5:02:01 AM (last edit: 4/29/2008 5:03:52 AM)
Using edit mesh is not cool though, not cool.
www.simonreeves.com - VFX Artist & Blog
www.analogstudio.co.uk <-- I work here
read 1101 times
4/29/2008 5:43:08 AM (last edit: 4/29/2008 5:43:08 AM)
Yeah it only works on editable poly objects so if you want to break all of elements out should collapse the mesh to an editable poly object if it's not before doing it.
Hallowed are the Ori!
read 1086 times
4/29/2008 1:25:04 PM (last edit: 4/29/2008 1:25:04 PM)