Created
June 5, 2014 17:29
-
-
Save gregtemp/987c5861f0d4e258b117 to your computer and use it in GitHub Desktop.
Aim a list of objects at the first object - in Maya
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
#aimAtFirst.py | |
import maya.cmds as cmds | |
selectionList = cmds.ls(orderedSelection = True) | |
if len( selectionList ) >= 2 : | |
print ( 'Selected Items: %s' %(selectionList)) | |
targetName = selectionList[0] | |
selectionList.remove (targetName) | |
for objectName in selectionList: | |
print ('Constraining %s towards %s' % (objectName, targetName)) | |
cmds.aimConstraint(targetName, objectName, aimVector=[0,1,0]) | |
else: | |
print ('Please select 2 or more objects') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment