Skip to content

Instantly share code, notes, and snippets.

@Onefabis
Created December 9, 2019 20:15
Show Gist options
  • Save Onefabis/ea25ad01f094e5a86dad6e1d808ab13b to your computer and use it in GitHub Desktop.
Save Onefabis/ea25ad01f094e5a86dad6e1d808ab13b to your computer and use it in GitHub Desktop.
place locators in space of selected object
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