View Full Version : [python] treeview

09 September 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 "" 1; //
// Error: Syntax error //

09 September 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!


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:

09 September 2010, 04:50 PM
ok thanks for your answer.

We'll add some external tools in this case.

CGTalk Moderation
09 September 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.