Created
December 9, 2019 20:15
-
-
Save Onefabis/ea25ad01f094e5a86dad6e1d808ab13b to your computer and use it in GitHub Desktop.
place locators in space of selected object
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 | |
locResult = mc.promptDialog( title='Insert Locators', message='Locator count:', button=['OK', 'Cancel'], defaultButton='OK', cancelButton='Cancel', dismissString='Cancel') | |
if locResult == 'OK': | |
locCount = mc.promptDialog( q=1, text=1) | |
if not locCount or not int(locCount) : | |
locCount = 1 | |
sel = mc.ls( sl=1 ) | |
for s in sel: | |
pos = mc.xform( s, q=1, t=1, ws=1 ) | |
for l in xrange( int( locCount ) ): | |
locName = mc.spaceLocator( n = s + '_' + str( l ) ) | |
mc.xform( locName, t=pos, ws=1 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment