Hi all: I know this has been covered b4, but I'm still having trouble with it. I have a UI which loads user-defined attrs (sliders) into an interface. These attrs are drivers for SDKs, so I have buttons to select the attrs so I can update the driven keys. I have a button to clear the panel (deleteUI) and then I'm able to recreate it based on the selection. Below is the function to recreate the slider panel, but of course the args for the button commands don't work, and I don't know how to fix it. I want to stick w/a Python-based solution.
Chad has a post at CGTalk for writing a callback class, but I don't know how to call it inside my function. http://forums.cgsociety.org/showthread.php?f=89&t=648707&highlight=args+loop Help would be appreciated. def fillUDPanel(): global sliderContainer sel=cmds.ls(sl=1) if len(sel) == 0: mel.error("You must have an object selected!") for obj in sel: attributes=cmds.listAttr(obj, ud=1) if not attributes : print obj,'doesn\'t have obj user-defined atttrs.' continue cmds.setParent('frameBegin') sliderContainer = cmds.frameLayout('sliderFrame',collapsable=1,l=obj ,bs="etchedOut") cmds.rowColumnLayout('sliderPanel', nc = 2, columnWidth=[(2, 40)]) for attr in attributes: fullName=(str(obj) + "." + str(attr)) cmds.attrFieldSliderGrp(cw=(1, 90),at=fullName,cat=(1, 'left', 10)) cmds.button(l='Sel',w=20, command = lambda *args: selectMe(fullName) ) -- http://groups.google.com/group/python_inside_maya
