cannot implement drag and drop with python

cannot implement drag and drop with python

Anonymous
Not applicable
639 Views
0 Replies
Message 1 of 1

cannot implement drag and drop with python

Anonymous
Not applicable
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?
0 Likes
640 Views
0 Replies
Replies (0)