Spring 2006 CS777: Computer Animation Project Description
K. D. Lee
Maya Plug-In Development (For Motion Processing Related Research)
Goal
v Simplify the process of doing various motion related research
v Understand and exploit Maya¡¯s architecture
v Create custom objects and commands that does motion processing
v Modify motions and motion attributes using Maya¡¯s user interface
v Enable interactive motion editing using Maya
Step 1: BVH file loading
Usage: Maya Command Line> OpenBVH
We can¡¯t do anything without motion, so the first step is being able to load a BVH motion into Maya.
BVH loading is done via a MEL script that is based on Sergiy¡¯s implementation that could be found
from http://www.highend3d.com/ and is also based on Sung Joo Kang¡¯s implementation.
Some minor bug fixes and error handling was added.
OpenBVH.mel, LoadBVH.mel
Currently there are parts of the project that assumes an UberSkeleton structure that looks like below.
However, trivial changes could be made to make the code work under different skeletal structures.
Step 2: Create a Maya object that represents a foot plant
Maya uses ¡®Locator¡¯ objects to represent objects that are transformable and
visible in the Maya view port but shouldn't be rendered. (eg. cameras, light sources)
Thus a ¡®Locator¡¯ is a good choice to represent foot plants, which should have
the capabilities of being moved around and modified directly in Maya.
The plants are represented with a simple blue color geometry that can be
seen below. As can be seen below, the plant gets highlighted when the current time
is in its constraint interval.
FootPlantLocator.h, FootPlantLocator.cpp, NewPlant.mel
Step 3: Automatic foot plant detection
Usage: Maya Command Line> FindFootPlants
Although, manually creating every foot plant is possible, it is generally much easier
to have an automatic mechanism to find foot plants and making adjustments from there.
Thus, an automatic foot plant finder was created (original code by Rachel Heck).
And GUI for setting various thresholds were written in MEL.
l Use *Wrists, *Fingers, *Heel, *Toes: Consider joints with names that end with either
Wrists, Fingers, Heel, or Toes as joints that could be constrained and find plants on them.
l Use nodes that match the below string: Uses joint name that you could manually specify
l Use selected joints: Uses Maya¡¯s current active selection list
FindPlantsCmd.h, FindPlantsCmd.cpp, FindFootPlants.mel
Step 4: Foot plant modification and proper position enforcement
Usage: Maya Command Line> FixPlantPos
During some manual adjustment after automatic plant detection, it is possible that
some plants maybe not in correct distance away from plants that require to be
in certain distance (distance between the 2 constrained joints on the limb).
In addition, some plants that have the same target joint may have overlapping time
intervals, which shouldn¡¯t exist. These should be merged to form a single plant.
Note
If no object is selected in Maya, the command solves all position conflicts by
giving plants that occur earlier in time priority.
If a plant is selected and the command is used, the selected plant remains
at its current location and plants that are affected by the selected plant¡¯s position
are moved to proper positions.
For detailed methods used for plant position enforcement, refer to the comments
in the below files.
FixPlantPosCmd.h, FixPlantPosCmd.cpp
Step 5: Foot skate solving
Usage: Maya Command Line> SolveFootSkate
Foot skate is a phenomenon that can occur due to various reasons. Noise in the initial
motion capture data could be a cause. In addition, various motion processing techniques
include motion path editing, motion blending, etc can introduce additional foot skating.
This is a surprisingly disturbing effect and various methods exist to correct this.
The method use in this Maya plug-in is the method described in the paper below.
Lucas Kovar.
Automated Methods for Data-Driven Synthesis of Realistic and Controllable Human Motion.
Ph.D. Thesis, Chapter 3 2004
This method uses limb stretching and motion displacement to satisfy the market
foot plant constraints. However, this method may still cause foot skating in systems
where limb stretching is not a possibility. This Maya command gives options between
not allowing stretching, scaling only along local Y axis, or uniform scaling.
There are times when using the specified plant positions isn¡¯t a desirable choice.
We can instead automatically find plant positions by un-checking the
¡®Use visible plant positions¡¯ check box.
FootSkateSolveCmd.h, FootSkateSolveCmd.cpp, SolveFootSkate.mel
FootSkateSolver.h, FootSkateSolver.cpp, ¡¦
Step 6: Motion path editing
Usage: Maya Command Line> MotionPathEdit
A transformable object to be used in motion path editing should be selected before
running the command. If only a transformable object is selected, a NURBS curve
representing the motion will automatically be created. If a transformable object and a
curve is selected, the motion path editor will use the curve instead of creating a new one.
Motion path editing describes in
Michael Gleicher, "Motion Path Editing"
2001 ACM Symposium on Interactive 3D Graphics
is a simple motion processing technique that transforms a motion
data into the local coordinates along a curve and when the curve is changed, this
transformed data is applied on top of the new local coordinates along the changed
curve. This is a simple enough method that could be calculated interactively.
When ¡®Start Edit¡¯ is pushed, a curve with the number of segments specified in the
GUI will be automatically computed and be visible in the screen. The selected
transformable object¡¯s key frames will all be deleted and will be animated by
a ¡®MotionPathEditNode¡¯ dependency graph node object interactively.
Maya¡¯s interface can be used to interactively modify the curve and see the
results in real time. Once the desired motion path is achieved, pressing the
¡®End Edit¡¯ button will set key frames for the transformable object and
remove the curve and ¡®MotionPathEditNode¡¯.
PathEditCmd.h, PathEditCmd.cpp, MotionPathEdit.mel
MotionPathEditNode.h, MotionPathEditNode.cpp
Conclusion
v Maya has a very well thought out API architecture that could potentially reduce the amount of coding
that is necessary for motion related research.
v However, computationally heavy tasks, accessing objects in Maya probably isn¡¯t as efficient as
normally hard coded programs.