I am working on a rigging tool to update SDK controllers.
Basically, it parses all the SDK connections to an object, and facilitates updating the SDK after repositioning the driven objects.
The application is for a skeletal facial system.
I have it working if the controller is a typical node which can be moved (ie from 1 to -1 in Y). It is easy to load the controller into the tool by selecting it and grabbing the selection.
However, I would also like to get it working for custom attributes, but how to grab them via a UI?
For example, say I have an empty group with an "open_close" slider as a custom attr - what tool could I build to allow the user to select that attr as the current attr?
If I could get the custom attr to be listed in the channel box, perhaps it could be selected (channels in the CB are selectable), but that doesn't happen automatically when the attr is added to the node.
Any suggestions?
Thanks.

NaughtyNathan

11-01-2010, 05:48 PM

you can see attributes in the outliner (if you turn on "Display > Attributes (channels)") which would allow users to select them easily. You could also create a very simple "picker" UI from a window with a form-attached textScrollList, that displayed a list of all custom attributes on the selected node (which you can query by: `listAttr -ud $node`). As soon as the user clicked an entry on the textScrollList you could fire off your process..?

Attributes aren't visible in the Channel Box unless they are keyable, so you could also make the custom attributes keyable and they'd show up in the channel box, but I'm not sure if that would actually work for all attr types..?

:nathaN

EightBit

11-02-2010, 05:59 PM

Thanks a lot Nathan:
The outliner is too messy, but I like your UI idea.
I've got it mostly working but when I grab the UD Attr from the textScrollList, I get unicode and I'm having trouble converting it to a proper string - any suggestions (see the errors in the 'selectAttr' def).
winName = "tmp"
if cmds.window(winName,exists=1):
cmds.deleteUI(winName)
testing = False
#Delete windowPrefs when testing, might generate error if existence is not tested for also:
if (testing and windowPref(winName, exists=True)):
cmds.windowPref( winName, remove=True )
cmds.window(winName,wh=(220, 180),resizeToFitChildren=True,title="test UD Attr Picker")
cmds.formLayout('attrForm')
cmds.text('UDAttrText',l="User Defined Attrs in Selected :")
cmds.textScrollList('UDAttrsList',h=110)