im trying to create a locator upon a button press from the user. i have it all set up to create the locator, but the locator actually appears on the screen upon the button release!.
is there a way to get the locator to appear literally when you press the button down??? - it can print text in script editor exactly on button press but not create it seems,
anyone know how?
heres the current code to create locator:
###############################################################
import maya.cmds as cmds
Context='Context'
def onPress():
print "pressing now!"
cmds.spaceLocator(p=(1,1,1))
if cmds.draggerContext(Context, exists=True):
cmds.deleteUI(Context)
cmds.draggerContext(Context, pressCommand=onPress, name=Context, cursor='crossHair')
cmds.setToolTo(Context)
###############################################################
def onPress():
print "pressing now!"
cmds.spaceLocator(p=(1,1,1))
cmds.refresh()
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c8ecae5e-97e5-4ad4-8d8d-b4f5632c998c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.