Friday, February 14, 2014

Refactoring Automated Alembic Export

PYTHON SOURCE CODE


BYU Animation Pipeline Workflow
Problem: While working on Owned, one of the things that became clear is that the tools we were using to move animated geometry between Maya and Houdini weren't as intuitive as they could have been and often produced undesirable results. As the diagram above suggests, the process of moving data between Maya and Houdini is fundamental for our pipeline. So, it's critical that these tools be working properly and naturally maintaining an automated process for the export helps ensure that the output of the exports are consistent. However, we experienced several problems towards the end of the film with this operation:
  1. Tagging geometry for export was not intuitive
  2. There was no control available on what to export and what not to
  3. Animation with parent constraints had to be exported manually 

BYU Pipeline Maya Shelf Tools: Owned Version
At the beginning of the development of the pipeline for Owned, it was quickly decided that making the pipeline commands accessible through custom shelf tools in Maya and Houdini. As shown above, we made tools available for checking files in and out, locking them during checkout to control editing, and we made tools for exporting Alembic files from animated geometry.

The animators were given a Maya file with references to the rig files for the characters and any other props that were needed for the scene. After the animators were done and ready to export the Alembic File, they were required to make use of the two tools highlighted above ("TG" for "Alembic Tagger") ("EX" for "Alembic Export").


(1) The Alembic Tagger is used to solve an issue with Houdini interpreting the geometry in the Alembic File. Houdini doesn't recognize the NURBS curves used to create the rig controls. So, all the geometry manipulated by the rig controls is gathered under one group separate from the controls themselves and the group is marked for Alebmic Export. So, the purpose of the Alembic Tagger is to assign and unassign the tags to the group.

Alembic Tagger: Owned Version
Looking at the UI for the Alembic Tagger above, there is a clear problem. There is no way to tag new groups. The tagging and untagging is limited to the groups listed here which are the ones that have already been tagged up to this point. What's more, the tag and untag buttons don't add and remove the groups from the list and so there is no way to tell if the tagging was successful or not. At the end of the film, no animator knew how it worked, so they just skipped over it altogether.


(2) Clicking on export scanned for everything actually available in the scene for the tag and gave no UI to specify what was ready to be exported and what was not.


(3) The Alembic Export tool did not scan for parent constraints that referenced controls in another rig.

Solution: So, to solve this problem I rewrote the tools in the shelf and added two more for convenience.

BYU Pipeline Maya Shelf Tools: Ram's Horn Version
 This now allows a rigger to use the "Tag" and "Untag" tools on the left to access the Outliner on their own, highlight the group they wish to tag or remove the tag from, and click on the tool to add or remove the alembic export tag.

To confirm the groups that have been tagged, they can make use of the "LS" command or in other words "List Alembic Export Tags". This will list all the groups in the scene with the tag. This is important because the Alembic Exporter will scan for the first tag it sees.

The Alembic Export tool then brings up a UI that allows the animator to select the rigs that have had their animation adjusted so only those will be exported as a new Alembic file. This tool will also scan for parent constraints that are referencing controls that are outside the current rig file so that it will be included for the animation information needed to get the proper behavior out of the child rig.