PDA

View Full Version : [python] treeview


holycause
09-16-2010, 03:56 PM
hi guys,

I'm new with maya and python, and i've some problems with the creation of a treeview.

how can i assign a function with the selectCommand ?


I tried several ways to write it, but always got errors back.

mc.treeView(tView, e=True, addItem = (f, os.path.basename(fol[0][0])),selectCommand = 'testFn() 1')

..............


def testfn():
print 'OK'


and get this error back

// Error: testFn() 1 "df.py" 1; //
// Error: Syntax error //

NaughtyNathan
09-16-2010, 03:59 PM
why do you have " 1" at the end of the string after the function?

either way, it seems like the current advice is to not use treeview!

http://forums.cgsociety.org/showthread.php?f=89&t=865911&highlight=treeview

:nathaN

P.S. actually, looking at that Ruben it appears to be a MEL error, which may mean that this $hitty command is also hooked up to python incorrectly:

http://forums.cgsociety.org/showthread.php?f=89&t=918843

holycause
09-16-2010, 04:50 PM
ok thanks for your answer.

We'll add some external tools in this case.

CGTalk Moderation
09-16-2010, 04:50 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.