TreeView draganddropcommand syntax error

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 05 May 2009   #1
TreeView draganddropcommand syntax error

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.
 
Old 05 May 2009   #2
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:55 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.