Archive for March, 2012

Tue, Mar 27th, 2012
posted by jjburton 01:03 PM

So at least to me, the maya.env setup has perpetually been an exercise in frustration. For years, it seemed it would remain shrouded in mystery. Recently as I’ve been making tools and learning I took some time to do some googling and I have a much better understanding of how to make it work  well so you don’t have to!

So, let’s set it up…

Homework first!

  1. Find your maya folder where your maya.env resides
    On a typical pc install, that will be ‘ \My Documents\maya\%version\’. In my case, it’s ‘X:\My Documents\maya\2011-x64’
  2. Remember where you installed the cgmtools repository to

Let’s get to it.
Note – this is for a Windows setup

  1. Make sure Maya is closed
  2. The first thing we wanna add is an inline variable we can call. This doesn’t have to be done but with multiple repositories, I found it easier. We’ll add this to the top
    REPOSPATH = X:/repos/
  3. Then if you already have some paths on Maya_Script_Path or PythonPath, you can amend them by putting the following at the end of each one followed by a ‘;’
  4. Open up Maya and type the following in a mel command line:

Here’s an example of a clean maya.env with no other paths added.

[crayon]REPOSPATH = X:/repos/



Tue, Mar 27th, 2012
posted by jjburton 11:03 AM

…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
Thu, Mar 22nd, 2012
posted by jjburton 03:03 PM

For users granted access to the repository for up-to-date tools and code this is run down on getting setup. Eventually we hope to have this all happen within Maya but for now, there’s some leg work. At present, we’re using as our code repository in the git format. This is tailored to a pc user, if we get it figured out for others, we’ll add that here.

For a great immersive, tutorial on learning git, check out gitimmersion.

For the everyday pc user…

  1. Sign up for a bitbucket account.
    If you have one already, move along…
  • Go through the tutorial to get a foundation on how stuff works.
  • At a minimum, you need to install msysgit from the tutorial. We only need step one install stuff
  • Get git permssion
    For now, this is a invitation only thing. You’ll get an invite to the repository after which you can connect to it
  • Decide where you wanna store stuff
    For myself, I created a ‘repos’ folder on my ‘x’ drive as I sync to several repositories. So my path I’ll be going to via gitBash
  • Get the git path
    If you have permission, you can go to bit bucket and see the path to sync to to clone the repository
  • Sync it up!
    1. Open git bash
    2. Browse to your directory to store stuff
    3. Type in the clone command
    4. Put your password in
    5. Let it finish up and you should see something like…
      gitBash install step screengrab
  • Check your work
    Make sure it pulled everything
  • Updating anytime is relatively straight forward anytime you please.
    1. Git bash to the cgmtools folder
    2. Type the following:
      git checkout
    3. Input your password and let the download finish
    4. Have a chocolate, you deserve it!

    After you’ve done this step, time to setup your maya.env

    Thu, Mar 22nd, 2012
    posted by jjburton 07:03 AM

    …with as little hair pulling as possible…

    So, setting up an IDE for doing coding is a pretty good idea if you’re gonna be doing a lot of it. My IDE of choice is Wing and it can be a little tricky getting things setup right for auto-completion. If you wanna get going with it, you can…

    1. First download it from their site
    2. Add maya’s mayapy exec as a custom Python Executable in Project Properties>Enviornment
    3. Add your repository as a custom Python path in the same section – in my case ‘J:\repos\cgmtools\mayaTools’
    4. Next see their doc page for maya for help
      1. I had to change one item for my own setup. Maya 2011’s pi file location ended up being:
        C:\Program Files\Autodesk\Maya2011\devkit\other\pymel\extras\completion\pi
    5. Add your own computer’s path in Preferences>SourceAnalysis>Advanced>Insert and put that path in there and you should be golden
    If you have to generate your own pi files for whatever reason…
    Start with the tutorial here to get you most of the way there.
    1. Now, when get to the the part about the genmayapi thing, you’re gonna wanna edit it cause it won’t work off the bat depending on your version of Wing.
      1. Lines 5 and 7 will need to be modifed to your version of Wing. In my case, it was ‘Wing IDE Personal 4.1’
      2. Line 12 will again need soe work, in my case it was ‘Wing Personal 4’.
        You can find the folder directly in windows at  C:\Users\%Name%\AppData\Roaming.
    2.  After those fixes you should be able to run the genmayapi and finish out the tutorial without issue.
    This was my

    [crayon]import os
    import sys
    import maya.standalone

    WING_DIR = r’c:\Program Files (x86)\Wing IDE Personal 4.1′
    if not os.path.exists(WING_DIR):
    WING_DIR = r’c:\Program Files\Wing IDE Personal 4.1′

    sys.path.append(os.path.join(WING_DIR, ‘src’, ‘wingutils’))
    import generate_pi

    PI_FILES_DIR = os.path.join(os.environ[‘AppData’], ‘Wing Personal 4’, ‘pi-files’)
    MOD_LIST = [

    def main():
    for mod in MOD_LIST:
    pi_filename = os.path.join(PI_FILES_DIR, os.sep.join(mod.split(‘.’)) + ‘.pi’)
    if not os.path.isdir(os.path.dirname(pi_filename)):

    print ‘Generating .pi file for’, mod

    f = open(pi_filename, ‘w’)
    generate_pi.ProcessModule(mod, file=f)

    if __name__ == ‘__main__’:

    Happy coding!

    Thu, Mar 15th, 2012
    posted by jjburton 11:03 AM

    We’re are very pleased to announce the launch of CG Monks – a small group of cg artists who like making the kind of stuff that makes this business of animation more intuitive and enjoyable.

    Throughout history monks of various traditions have worked away perfecting their various crafts and leaving posterity beautiful manuscripts, art and traditions that we can all admire even when we may not share their individual beliefs. Their callings were consistently to be more than about themselves. That endless pursuit of perfecting one’s own craft, not to gain fame or fortune but for the sake of perpetual improvement is one that we strive for.


    Our goals include:
    • Providing work for hire TD and animation work
    • Creating  commonsense tools we actually use them on a daily basis including our own modular character rigging system
    • Creating a community collaborative site that acts as a virtual studio, place to get community vetted tools and assets, and to get questions answered
    • Creating stable character (including Morpheus 2.0) and prop assets that follow common sense and animator friendly standards.
    Check back soon!