Created
May 18, 2022 08:15
-
-
Save Dogydogsun/3b640a718f50e6e96617623fcd17eed7 to your computer and use it in GitHub Desktop.
Short Maya Python script to create clusters for all sub-elements of a geometry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
for sel in cmds.ls(sl=True): | |
dup = cmds.duplicate(sel) | |
cmds.polySeparate(dup) | |
parts = cmds.ls(sl=True) | |
parentGrp = cmds.listRelatives(p = True) | |
for part in parts: | |
cmds.select(part) | |
cmds.cluster() | |
cmds.cluster(e=True, g=part, rm = True) | |
cmds.delete(part) | |
cmds.delete(parentGrp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment