Created
July 29, 2017 21:32
-
-
Save splinecraft/0215762f041b313bc2883615301115c6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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') | |
if constraint: | |
constraint = constraint[0] | |
src = mc.listConnections(constraint+'.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