What’s in a name…


…Apparently a whole lot.

So some time last year when I was working through learning python and working on our rigging modules I said to myself, “Self, it sure would be nice if you didn’t ever have to worry about naming anything by hand anymore.”

“Self, ” I replied…to myself of course,” what a great idea, surely we can knock that out in a couple of days.”

Turns out, I lie to myself pretty well as I’ve been plugging along on this issue ever since between gigs and it’s been almost a year now and it’s just now about finally where I want it to be. All of our modules and functions use this system as it just really makes it easier to keep a scene clean.

As a quick overview, here’s the basics of how it works…

  • The gist of it:
    • Any object in a scene can generate a name dictionary
    • The minimum a dictionary holds is the objects type which is inferred by logic (groups, shapes and other specific types are detected)
    • Before going into the name dictionary, tag info is check against a user editable short hand config file for short versions of text: ‘left’ becomes ‘l”, “right” becomes ‘r’, ‘joint” becomes ‘jnt’
    • Objects may be tagged with a variety of tags. Currently: name, position, direction, type, iterator and modifiers for all but iterator
    • Names are inherited so for example if you have a chain of objects and you tag the first one with a name tag, all other object in that chain will inherit that name tag unless assigned a different one
      • Other examples of auto inheritances are:
        • shapes always inherit their information from their transform
        • Groups inherit information from their first child
    • Tags may be strings, connected attributes or message connections to a specific object.
      • message connected names are treated as special cases. For example a locator created from another object will be message tagged to ‘object’ so that the locator is named ‘object_loc’ and it’s name tag will always update to whatever that object’s name is changed to.
    • When a name is created from a name dictionary, it combines in the order and with the joiner (‘_” is default). Those settings are found in the config file
  • Current gui tool fuctions include:
    • Tag and Release
      • Object load with preview of what name will be with the naming tool
      • Navigation – load child/parent
      • Name loaded object or the descendants of the loaded object
      • Easy change tag fields which auto update with current information from the loaded object (color coded  for keyed values, connections and parent tags)
      • Right click menu on tag fields for selecting parent tag objects, or connected objects
    • Selection based tools
      • Multi tag editing
      • Copy tag from first to others
      • Swap tags
      • Clear tags
      • Name selected
      • Update name – loads the objects current name to the name tag, then names the object
      • Name Heirarchy
  • Assertions:
    • A given name can only be used by one object in a scene
    • An objects iterator cannot be 0 unless no other object in the scene either has that objects name or name dictionary
    • Named objects have priority to iterators they bare
Be Sociable, Share!

Comments are closed.