draggerContext holdCommand not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am adding holdCommand in draggerContext.
it doesn't do anything. is this a bug?
I am using example from help doc and just added hc = 'print("holding")'
import maya.cmds as cmds
# Procedure called on press
def SampleContextPress():
pressPosition = cmds.draggerContext( 'sampleContext', query=True, anchorPoint=True)
print ("Press: " + str(pressPosition))
# Procedure called on drag
def SampleContextDrag():
dragPosition = cmds.draggerContext( 'sampleContext', query=True, dragPoint=True)
button = cmds.draggerContext( 'sampleContext', query=True, button=True)
modifier = cmds.draggerContext( 'sampleContext', query=True, modifier=True)
print ("Drag: " + str(dragPosition) + " Button is " + str(button) + " Modifier is " + modifier + "\n")
message = str(dragPosition[0]) + ", " + str(dragPosition[1])
cmds.draggerContext( 'sampleContext', edit=True, drawString=message)
# Define draggerContext with press and drag procedures
cmds.draggerContext( 'sampleContext', hc = 'print("holding")',pressCommand='SampleContextPress()', dragCommand='SampleContextDrag()', cursor='hand' );
# Set the tool to the sample context created
# Results can be observed by dragging mouse around main window
cmds.setToolTo('sampleContext')