Message 1 of 1
cannot implement drag and drop with python
Not applicable
04-27-2009
03:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am translating a tool from Mel to Python but I am trying to implement some drag and drop operations between UI elements using python but Maya crashes producing a fatal error.
My procedure is about the following.
---------------------------------------------------------------------------------------------------------------------------
...some code....
lbl_sectionTitle = cmds.text(label="State Machine", dragCallback='callbackName')
... more code ...
scrlLyt_statesWindow = cmds.scrollLayout(dropCallback='dropClipCallback')
... more code ....
def dropClipCallback( dragControl, dropControl, messages, x, y, dragType 😞
print "Dragged has been performed."
def callbackName( dragControl, x, y, modifiers 😞
print "Dragged has been performed."
return dragControl
------------------------------------------------------------------------------------------------------------------------------
When I run this code and I try to drag anything in the scrollLayout nothing happen . no Printing. and then often but not all the time. Maya crashes.
The equivalent logic in Mel works fine.
Any idea?
I am translating a tool from Mel to Python but I am trying to implement some drag and drop operations between UI elements using python but Maya crashes producing a fatal error.
My procedure is about the following.
---------------------------------------------------------------------------------------------------------------------------
...some code....
lbl_sectionTitle = cmds.text(label="State Machine", dragCallback='callbackName')
... more code ...
scrlLyt_statesWindow = cmds.scrollLayout(dropCallback='dropClipCallback')
... more code ....
def dropClipCallback( dragControl, dropControl, messages, x, y, dragType 😞
print "Dragged has been performed."
def callbackName( dragControl, x, y, modifiers 😞
print "Dragged has been performed."
return dragControl
------------------------------------------------------------------------------------------------------------------------------
When I run this code and I try to drag anything in the scrollLayout nothing happen . no Printing. and then often but not all the time. Maya crashes.
The equivalent logic in Mel works fine.
Any idea?