Attribute Collection V2.0

by Roland Reyer
April 2004



Attribute Collection is a Maya script that helps you create your own user interface (UI). It lets you select channels (attributes) in the Channel Box and creates fields and sliders for these channels in a new panel or window.

 

You can then interactively:

 


Important Note: This script is NOT an "official" product of Alias Systems.
The hotline will NOT give you support if you have trouble with it.
If you are having problems with this script, please feel free to mail me directly (roland@alias.com).
Since this script is just a hobby, I cannot guarantee to answer within a certain time.
I hope you find it useful and I appreciate any comments, suggestions and bug reports.


Note: This documentation is just a first version. Please check the Alias website for updates.


Contents

First Steps
The Default UI
Edit a "Group"
Direct Editing
The UI Tree and the Hierarchy Window
Anatomy of the UI
Node Name Substitution for Button/Icon Scripts
Problems loading files with UI?

Compatibility Notes
Notes for TDs/Developers





 First steps

Copy the script ac.mel to your scripts folder (usualy "My Documents\maya\scripts").
(if you are also using the old attrCollection.mel script, then source ac.mel before you begin)
  1. In Maya select some channels (attributes) in the Channel Box
  2. In the Bonus Tools Menu select Attribute Collection
    ...or...
    In the Commandline type "ac" and hit Enter

First Steps




The Default UI



What you see now is the default UI of Attribute Collection. It is a panel with two pulldown menus, a tabLayout with one tab ("Tab1") and then a "Group" layout with an entry for each selected channel.

A Group is a collapsable frame layout with a title and six default buttons at its bottom.

The default buttons apply to the channels in this group.

By default the channels are labeled with their object.attribute name. You can change the default label type in AC2.0->Preferences.

Under the frame of the first Group there is a button "Add to new Group". Select  some more channels in the Channelbox and click this button to create a new group.




Edit a "Group"

  1. To edit a Group click its "Edit..." button

Edit a Group



Direct Editing

There are several ways to edit and modify the UI.





  • you can also use MMB Drag&Drop between different Edit Windows
    and between Edit Windows and the UI




Limitations and Exceptions for Drag&Drop:
  • Separators cannot be drag&dropped.
  • You can't drag a parent (i.e. a Group) onto one of its children.
  • Button Rows can be dragged by grabbing one of the buttons.
  • If you drag an entry onto an empty Group or Grid, then the entry will become a Child of that Group/Grid (will not be inserted before the Group/Grid)




The UI Tree and the Hierarchy Window

There are two useful views at the database of Attribute Collection:

For a look at nodes that are created by Attribute Collection choose Edit->UI Tree
The Hypergraph window shows the contruction history that is saved with the scene. The script node on the right is executed when the scene is loaded and it draws the UI.
In the Edit Window of Attribute Collection you can walk up and down in this hierarchy.



 



For the Hierarchy Window choose Edit->Hierarchy Win.
This window is a "rough" representation of the node-hierarchy.
In this window you can also use MMB Drag&Drop and RMB Popup menus.
(Important: please note the different MMB/RMB regions for parent- / leaf-entries)






 





Anatomy of the UI


The UI in Maya is a hierarchy.
This hierarchy is shown in the Edit Window. You can explore the branches of the hierarchy by double-clicking an entry - or click "Parent" go up in the hierarchy to the parent of the shown UI elements.


The following two images illustrate the anatomy of the UI in Maya.

  • This UI (built in Attribute Collection) ......

Anatomy Example

  • ... has this anatomy ...

anatomy


... and this is the Hierarchy View of the UI:





Node Name Substitution for Button/Icon-Scripts

The script in the entry types "Button", "ButtonRow" and "Icon" will be updated on node/attribute name changes.

All the "node.attribute" names that are properly enclosed in double quotes will be connected to the entry.

Example: all these attribute names are recognized:

"pShere1.tx"
"blendshape.weight[0]"

"ref:loaded.visibility"



And these names will NOT be recognized:
 

pShere1.tx
(no quotes)
"blendshape.weight[" + $i + "]"
(no varables allowed)



You can test this by entering a script for a button (like "setAttr "pSphere1.tx" 5,") in the Edit Window.
Then close the Edit Window, rename pSphere1 to something else, and re-open the Edit Window.
The Script shows the new object name.





Problems loading files with UI?

There might be an error message when you try to load a file with custion UI.

To get rid of these error messages you should include the line "source ac.mel;" in the file userSetup.mel which resides in the scripts directory (create the file if nessesary).


Compatibility Notes

If you have used the "old" Attribute Collection (Version 1.7) you could try to load the files with the new version.
  • Please remove the old attributeCollection.mel from your scripts directory.
  • Then create a new (empty) attributeCollection.mel with the content: source ac.mel
  • In Maya source ac.mel
    (if you get errors or warnings then repeat this step a few times).
  • Then load the scene with the old Attribute Cillection UI.
AC2.0 will try to convert the old script nodes. A window lets you then delete the old script node.




Notes for TDs and Developers

You can integrate your own UI-types in Attribute Collection.
There are hooks that let you define a new type that will then be managed by Attribute Collection.
For more information please send me a mail: roland@alias.com


You can load the same UI as a reference into different scenes. In this case the UI node are disconnected and Attribute Collection finds the objects just by name in a certain namespace.
For more information please send me a mail: roland@alias.com