I'm trying to pass a python function to an itemFilter, which doesn't seem to work. The problem seems to be that a DAG nodename is passed implicitely to the function, which causes a syntax error when passed like this
cmds.itemFilter("myFilter", byScript = "myFilterProc()")
filter = cmds.itemFilter("myFilter", byScript = "myFilterProc()")
cmds.outlinerEditor(name, edit = True, filter = filter)
# Result: #
// Error: myFilterProc() "persp"; //
// Error: Line 1.22: Syntax error //
// Error: myFilterProc() "perspShape"; //
// Error: Line 1.27: Syntax error //
In the above result that Maya script editor spits out you can see that
is called. "persp" is the argument for the preceding function name. Which means one cannot use a python function to pass to a -byScript flag for an itemfilter. Unfortunately the python itemFilter -byScript docs are the same as the mel docs.
Has anyone had any success with that before?