attrTools 2.0


WIP Tool

2.0 attempt at working with attributes in Maya.

Features

  • Easy attribute adding, setting and editing
  • Succinct, sortable display of node attributes and data about them
  • Value pushing – current data, next/previous frame, forward/back on timeline and all.
  • Multi setting and more

How do I use it?

If you have the cgmToolbox installed:

  • cgmToolbox menu>rigging>cgm.attrTools
    • If you want the old one. menu>legacy>cgm.attrTools
  • Python –cgm.core.tools.attrTools.ui()

Menu

  • Context – Introduced this concept with our 2.0 rewrite and the marking menu. In short, it is an easy way to work on numerous items at once in a clear manner. Not every function in the ui is contextual.
    • loaded – Any objects loaded in the tool will be acted on
    • selection – Only act on selected nodes. Attributes in context will be those selected in ui, then any selected in channel box will be extended to that list.
    • children — may go away, testing for attrTools
    • hierarchy — may go away, testing for attrTools
    • scene — may go away, testing for attrTools
    • report — Report current context data without making any value or time changes
  • Values – For value pushing. What values will be pushed in selection and key context
    • primeAttr – The current values of the first attribute in your ui selection will be pushed
    • primeAttrPer – For each key, the primeAttr’s value at that time will be pushed to the others
    • primeNode – The current values of all selected attributes in the ui will be pushed
    • primeNodePer – For each key, primeNode’s selected attrs will be pushed to other nodes
    • each – Each contextual object’s current values will be pushed
    • report — Report current value data without making any value or time changes
  • Keys – 
    • primeNode – The keys of the primeNode will be used
    • each – Each object’s keys will be used for their respective value pushes
    • combined – The keys of all contextual nodes are combined and each object will be value pushed on each of those keys
    • report — Report current key data without making any value or time changes

Objects

  • Load selected — loads selected objects to the ui. First object is the ‘prime’ object.
  • Report — may get rid of, just playing with if necessity
  • Clear — clear selected objects

Sort Row

  • Sort – Sorts loaded attributes alphabetically
  • Shared — if more than one object is loaded, ONLY loads attributes shared by loaded objects.
  • Default– Designed to quickly get the most useful attributes
    • On – Only loads ‘normal’ attributes which are keyable and or user defined
    • Off – every settable attribute loads
  • User – load user defined attributes or not
  • Others – Every attribute on the object

Attribute list

This may seem overwhelming at first but it’s not too bad once we break it down. Each line is an attribute. You can select more than one attribute at once. Let’s look at a couple examples:

“settings –(enum)– //u v k // off”

  • settings – the attribute long name
  • enum – attr type
  • u – user defined
  • v – visible in channel box
  • k – keyable
  • off – current value

“rotateX–alias(test)–(da)–//  v  //<anim< // >>> //30.0”

  • rotateX — attribute long name
  • alias(test) — our attribute has an alias named ‘test’
  • da – doubleAngle attr type
  • v – visible in channel box
  • <anim – animation curve input (it’s keyed)
  • >>> – outbound connection on this attribute
  • 30.0 – current value

Right Click Menu

Most of these functions are multiset. Meaning any selected attributes on loaded objects will be modified. Providing an empty dialog with ‘ok’ will clear said value in general. For example, clearing the defaultValue from the dialog in the promptDialog will clear the defaultValue on the selected attribute(s).

NOTE – you must reselect the attributes if you make selection changes and in selection context so the menu can rebuild. It rebuilds on ui selection.

  • Set Value — If you a message attribute is selected, selected objects will be stored. Otherwise, a promptDialog is offered to provide a value.
    • enums may be set by index or string
    • list values are accepted via comma split for vector type attributes
    • bool accepts 1/0,t/f,true/false,y/n,yes/no
  • Standard Flags
    • Lock and Hide — both at once
    • Unlock and Show — both at once
    • Keyable/Locked/Hidden — Bool options to change values
  • Connections
    This one is a lot packed into a single section. Let’s dig in.

    • In
      • obj.attr – If connected, name of driver
      • Select – Select the connection
      • Load – Load the driver to the ui
      • Break – Break connection
      • From All – Only enabled with multiple selected objects. If enabled, connects all the prime attributes from the specified object back to our prime.
      • From Channelbox – Only enabled if there are channelbox selected attributes AND the len of channelbox attrs match that of the prime attrs. Uses the channelbox attrs to drive from our specified object
      • List of attributes of our driven
        • List of objects we can connect in
          • List of attributes to connect in
    • Out
      • List of driven attributes
        • Select – Select the connection
        • Load – Load the driver to the ui
        • Break – Break connection
      • To All – Only enabled with multiple selected objects. If enabled, connects all the prime attributes from prime to selected objects or all others
      • To Channelbox – Only enabled if there are channelbox selected attributes AND the len of channelbox attrs match that of the prime attrs. Uses the channelbox attrs to drive from our specified object
  • Name
    • Rename – Only userDefined attribute may be renamed
    • Nice – Set the nice name of an attribute
    • Alias – Set an alias of an attribute
  • Numeric
    • Default/Min/Max/softMin/softMax – Set and clear values
  • Utilities
    • Add – add a new attribute from a selection of types. A promptDialog is provided to name it.
    • Convert – Convert a userDefined attr to another type
    • Copy – Copy the selected attributes in context to other targets. A promptDialoge is provided to get a name
      • To – Copy from the primeNode to other targets
      • ConnectBack – Copy and connect back to the primeNode. Driving the primeNode
      • ConnectTo – Copy and connect to the other nodes. Driving the new attributes.
    • Duplicate – Duplicate an existing attribute on the loaded objects. A promptDialog is provided to name it.
    • Delete – Only userDefined attributes may be deleted.

Move Row

Move buttons only show up when user defined attributes are visible. The let you move attributes in the channel box that are visible.

Push Values

Values are pushed on nodes by their context, values and key options in the menu at the top of the ui.

  • Current — Push the current values to contextual nodes. If only one node is loaded if you’re not in primeAttr or primeAttr per node, it’s not gonna do anything.
  • <<Back –Push to all previous keys from the current time
  • <Prev — Push to the first previous key from the current time
  • All — Push to all contextual keys
  • Next> — Push to the next key from the current time
  • Fwd>> — Push to all keys after the current time

 
Creative Commons License

Categories