im trying to create a sphere with an onPress() call and then when the user begins to drag the cursor i want the sphere to move like the central move manipulator had been selected.
However it seems i have to release the button press and then select the move tool and pyhsically grab the central move manipulator if i want to do it. I really need to be able to do the sphere creation and sphere positioning all in one 'click and drag' action.
hope this makes sense. the code is below. All i need is a command which will allow the newly created sphere to accept normal movement input from the mouse during the 'onDrag()' call.
####################################################
import maya.cmds as cmds
Context='Context'
#sphere is created at 0,0,0
def onPress():
cmds.polySphere()
cmds.refresh()
def onDrag():
#here: as the user drag the mouse the sphere should follow the movement of it.
cmds.refresh()
if cmds.draggerContext(Context, exists=True):
cmds.deleteUI(Context)
cmds.draggerContext(Context, pressCommand=onPress, dragCommand=onDrag, name=Context, cursor='crossHair')
cmds.setToolTo(Context)
##########################################################
thanks all, any help would be super
Sam
cmds.setToolTo('moveSuperContext')
cmds.refresh()
in the onDrag() function. This is basically what i want but with the cursor movements controlling the move pivot