Saturday, September 1, 2012

3dsmax Animation Referencing and Scene Building

Having worked on many game titles in the past its quite clear that scene building and having a way to reference or quickly update characters and rigs is very important. If you work in 3dsmax you are probably quite aware and envious of the referencing capabilities that exist in Maya. This functionality is clearly missing from 3dsmax and may likely never appear. Sure there are Xrefs but be my guest if you choose to use them and discover you don't get nearly what you need with the added benefits of instability.

So out of necessity I started work on what ultimately became our Animation Asset Manager ( AM ). The tool merges assets, Characters, Weapons, Vehicles, Props, Environments, etc. in a quick and efficient manner. Straight ahead file merging can result in a very messy file, as 3dsmax does not have native "namespace" functionality, and there may end up being a lot of object name collisions and rig linking errors. The Asset Manager handles all of these issues and bundles all of the incoming file objects into one "Asset". Now working in hugely complex scenes is quite easy as thousands of objects can now be represented as one Asset.

Adding an Asset
  • The artist chooses the asset type to add
  • Selects a file from a list of assets or locate a specific file on disk 
  • Provide a unique name to represent the Asset
  • Add the number of asset instances

AssetManager - Add Character Asset
What actually happens behind the scenes is a bit more complex. The incoming file is first validated to make sure it is export ready. If the AM finds everything it needs for that asset type then it will fully merge the file. After merging, the incoming objects are checked and objects unnecessary for animation/export purposes are removed, shaders are converted to standard materials, all objects are stamped with Asset Attributes, and finally object names and layers are properly namespaced. The attributes that were added to each object were done to easily classify the objects under one "Asset". When the AM updates it scans the scene and represents each asset properly by querying the object attributes. In the past I used very light-weight user defined properties but I have converted to custom attributes as these can be properly transported between DCC apps and maintained in the FBX file format.

AssetManager - Asset Objects

Swapping an Asset - Poor Man's Referencing
As characters, weapons or props are updated the animators need to be able to easily update to the new asset when necessary. Cosmetic changes don't always mean an update needs to happen but specific rig changes may require updates. Scene callbacks are put in place to verify animated assets in files are up to date in regards to explicit external file references that are checked on scene open. The AM ensures that these objects can be swapped and any animation existing in the file is maintained, this is where a great deal of the code in this tool comes into play. This includes full character animation, IK objects, morph animation, external link constraints and any other custom animations related to the asset. We employ our own save animation functions to handle everything outside of the basic biped motion to ensure keys and motions are maintained between potentially different objects. However, making sure everything transfers properly is reliant upon making sure all animated assets are marked up properly during asset creation, another topic for another time.

Weapon Updating
Weapons are connected to our characters in a specific manner and in the past allowing animator's to do this by hand resulted in inconsistent errors and issues between DCC app and the game. The AM brings the updated weapons into the file and makes sure the weapon's are aligned and linked properly to the character. Updating the weapons is just as easy as hitting the update button when necessary. The weapon is removed from the file, the source asset file is synced in source control, and finally updated into the current animation file.

AssetManager - Update Weapons

Demonstration Video
You can watch a demonstration of the scene building and swap process below. The tool and functionality was developed and improved upon over the course of a couple projects. It was used to construct animation scenes and cinematics from our latest title Saints Row: The Third

                           Animation Asset Manager - Randall Hess from Randall Hess on Vimeo.

No comments:

Post a Comment