Hello, 

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

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/4bc37c8f-344f-43a4-9356-983f4123e23c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to