Created
May 12, 2016 07:29
-
-
Save fereria/8d52798b3e69ea8b71511cbe363de41b to your computer and use it in GitHub Desktop.
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 mc | |
selection = mc.ls(sl=1) | |
toSelect = [] | |
for item in selection: | |
constraint = mc.listConnections( item+'.parentInverseMatrix[0]', d=1, s=0,type='constraint') | |
for i in constraint: | |
src = mc.listConnections(i+'.target[0].targetParentMatrix', d=0, s=1) | |
if src: | |
toSelect.extend(src) | |
try: | |
mc.select(toSelect) | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment