View Full Version : Disecting an poly object into faces

09 September 2010, 08:58 PM
Hey there, I want to extract all faces on a poly and used this code:

obj =
nrVtx = cmds.polyEvaluate(obj[0], vertex=1)

for i in xrange(nrVtx-1):
cmds.polySplitVertex('%s.vtx[%d]' % ( obj[0], i), constructionHistory = 0)

cmds.polyExtrudeFacet(obj[0], localTranslateZ = -.1, constructionHistroy = 0)
cmds.polySeparate(obj[0], constructionHistroy = 0)

but as soon as I hit a certain iteration step (around 300) during polySplitVertex I run out of memory.
What optimization steps can I make in addition to the one above( no history build-up )? Or is this the wrong way? I would like maya to free memory after every step, and finally hit 5000 iterations or even more... and any tips on speed improvements? I know I want much. i am greedy :)


09 September 2010, 10:11 PM
why on earth are you iterating polySplitVertex over each vertex in turn? just apply it to the whole object like you do with extrude.
cmds.polySplitVertex(obj[0], constructionHistory = 0)do you mean for your "face plates" to be inside-out btw..?

09 September 2010, 10:43 PM
I would go with nathans suggestion. With regard to freeing up memory, perhaps try the undoInfo or flushUndo command.

09 September 2010, 08:00 AM
Oh, I can do that... well that is much more memory friendly. After that I reverse normals on the polys so that everything is fine again.

Will check out flush undo


CGTalk Moderation
09 September 2010, 08:00 AM
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.