Explode object by face, Python script, Maya

Capture

You might wonder why exploding objects into faces in Maya is such a pain! well, paste the following python script in the script editor to explode object into faces. Select your object first, then run the script.

Python Code:


import maya.cmds as mc
cLst = mc.ls(sl=True)
faces = mc.polyEvaluate(cLst,f=True)

def divLag(b):
 mc.polyChipOff (cLst[0]+".f[0:%d]"%faces,kft=False,dup=False)
 mc.polySeparate (cLst,rs=True,n="piece#")
 vLst = mc.ls(sl=True)
 return vLst

print divLag(faces)

 

 

Here is the Tutorial if you do not know where the script editor is and how to insert and run the code:

https://www.youtube.com/watch?v=eXFGeZZbMzQ

 

5 thoughts on “Explode object by face, Python script, Maya

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s