PDA

View Full Version : TreeView draganddropcommand syntax error


Soviut
05-04-2009, 03:38 PM
I'm using the TreeView control in Maya 2009 but I'm getting a syntax error on drag and drop. My code is as follows (simplified for brevity):


class View(event.Dispatcher):
def __init__(self):
self.window = cmds.window()
tree_view = cmds.treeView(
numberOfButtons=1,
allowReparenting=True,
dragAndDropCommand=self.tree_view_onDrag
)
cmds.showWindow(self.window)

def tree_view_onDrag(self, dropped_items, old_parents, old_indexes, new_parent, new_indexes, item_before, item_after, *args):
print "worked"


When I drag and drop and element I get the following command is executed in the console:

<bound method View.tree_view_onDrag of {"layer 3"} {""} {1} "layer 1" {0} "" "layer 2";


And get the following error:

// Error: <bound method View.tree_view_onDrag of {"layer 3"} {""} {1} "layer 1" {0} //
// Error: Line 1.1: Syntax error //

I've tried adjusting my callback method by only accepting *args, as well as making it a function rather than a method, but nothing is working.

CGTalk Moderation
05-04-2009, 03:38 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.