i added you to the edit list. anyone else who wants on, just let me know. google docs does not allow me to open to everyone automatically or i would. you'll see there is a BUG/SUG# column in the spreadsheet: i highly recommend submitting your bug to autodesk or else it might not get fixed. one thing we really need help with is testing these various bugs in the latest releases. as you mentioned, some of them may have been fixed in 2009 sp1.
i checked and your bug is not in the document. there is one very similar: "scriptTable getCellCmd does not work with python object as callbacks". there is also an enormous issue plaguing all callbacks, where callback functions are passed the strings 'true' and 'false' or '0' and '1' instead of actual boolean/integer/float values. as many of these bugs as can be fixed via workarounds are fixed in pymel, which is another reason we need to know which version of maya the problem is properly fixed. if you're using pymel, you could take a look at how we fixed the scriptTable issue, and implement a similar fix. -chad On May 27, 2009, at 8:18 AM, therrell wrote: > > looks like autodesk has released a service pack for maya2009. > mentioned in the additions to this is a fix for python where UI > callbakcs return values had problems. > not sure if this is the fix i am looking for, becuase i am in > production at the moment and can't reinstall the new maya2009 just > yet. > will let you know. > > in the mean time, > i have worked around the issue by creating and assigning mel callback > procs that call the python callback functionality, > ie. passing python the return values properly through a flaming hoop! > at least if this gets fixed it will be an easy mod to my script. > > cheers. > > > On May 26, 12:03 pm, chadrik <[email protected]> wrote: >> yeah, that looks exactly like the error that you get when a callback >> does not support python. autodesk has been trying to find and fix >> these broken callbacks since 8.5, but it looks like they may have >> overlooked it when implementing this new one. >> >> since autodesk does not have an open bug tracker, the pymel group >> hosts a google doc with python-related bugs: >> http://spreadsheets.google.com/ccc?key=pdI8BlSwGdr0btApDuZEcKQ&inv=py >> ... >> >> feel free to post.... >> >> -chad >> >> On May 25, 2009, at 4:11 PM, mtherrell wrote: >> >> >> >>> can anyone shed some light on this? >>> i am trying to use the new 'treeView' gui in python. >> >>> this gui comes with allot of great callback triggers and would have >>> allot of great functionality for what i am trying to use it for. >>> however, i am currently stumped: >> >>> i cannot assign python functions as callbacks. >>> i have tried every conventional way of doing this, ways that work >>> find >>> on other interface callbacks, >> >>> (string formating for positional arguments, lambda, functions that >>> accept variable numbers of args.. >>> below are examples of each). but i always get an error with a memory >>> address included. like: >> >>> // Error: <function at 0x000000001E39A208> "layer 1" "newname"; // >>> // Error: Line 1.1: Syntax error // >> >>> is it possible that even though they say this gui is availabe for >>> python, that it really is not??!, because this looks like it may be >>> expecting only a mel proc as a callback.... because of the syntax >>> error thing. >> >>> here are four python examples of ways of doing this that work fine >>> on >>> other gui: >>> (i am creating the callbacks on the 'editLabelCommand' signal. >>> so try to double click on the treeViewItem and rename it after >>> creating each example to see my problem) >> >>> ###### example1: positional arg failure treeView example >>> def foo(a, b): >>> print a, b >>> return a >> >>> from maya import cmds >>> window = cmds.window() >>> layout = cmds.formLayout() >> >>> control = cmds.treeView( parent = layout, numberOfButtons = 3, abr = >>> False, elc = foo) >> >>> cmds.formLayout(layout,e=True, attachForm=(control,'top', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'left', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'bottom', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'right', 2)) >> >>> cmds.showWindow( window ) >> >>> cmds.treeView( control, e=True, addItem = ("layer 1", "")) >> >>> ###### example2 wild-card args function positional arg failure >>> treeView example >>> def poo(*args): >>> print "callback args: " + str(args[1:]) >>> return args[1] >> >>> from maya import cmds >>> window = cmds.window() >>> layout = cmds.formLayout() >> >>> control = cmds.treeView( parent = layout, numberOfButtons = 3, abr = >>> False, elc = poo) >> >>> cmds.formLayout(layout,e=True, attachForm=(control,'top', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'left', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'bottom', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'right', 2)) >> >>> cmds.showWindow( window ) >> >>> cmds.treeView( control, e=True, addItem = ("layer 1", "")) >> >>> ###### example3: "catch-all arg" lamba positional arg failure >>> treeView >>> example >>> def goo(arg1,arg2): >>> print "callback args: " +arg1) >>> return arg1 >> >>> from maya import cmds >>> window = cmds.window() >>> layout = cmds.formLayout() >>> elc_cmd = lambda *args: goo(arg1,arg2) >>> control = cmds.treeView( parent = layout, numberOfButtons = 3, abr = >>> False, elc = elc_cmd) >> >>> cmds.formLayout(layout,e=True, attachForm=(control,'top', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'left', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'bottom', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'right', 2)) >> >>> cmds.showWindow( window ) >> >>> cmds.treeView( control, e=True, addItem = ("layer 1", "")) >> >>> ###### example4: string positional arg failure treeView example >>> def goo(arg1,arg2): >>> print "callback args: " + str(args[1:]) >>> return arg1 >> >>> from maya import cmds >>> window = cmds.window() >>> layout = cmds.formLayout() >>> elc_cmd = "goo(\'%(1)s\',\'%(2)s\')" >>> control = cmds.treeView( parent = layout, numberOfButtons = 3, abr = >>> False, elc = elc_cmd) >> >>> cmds.formLayout(layout,e=True, attachForm=(control,'top', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'left', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'bottom', 2)) >>> cmds.formLayout(layout,e=True, attachForm=(control,'right', 2)) >> >>> cmds.showWindow( window ) >> >>> cmds.treeView( control, e=True, addItem = ("layer 1", "")) >> >>> ## thanks for any help! >> >> > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
