This exercise was an exploration of combining Maya and Python using motion capture data.
As a re-introduction to Maya Expression Language, we wrote some procedures to query the coordinates of an object's vertices,
then draw a curve through them.
The "getVertices" procedure stores the XYZ data in a global variable, "$data". The next procedure compiles the data into a Maya curve command, then runs it.
Next, Malcolm asked us to convert the code from MEL to Python. This was fairly simple using the knowledge from the previous projects.
Using this method, I hand animated some mocap information to render as curves.
Once in Maya, I interpreted .txt mocap data using Malcolm's script "MoCapDB", which can be used to query and gather
various types of information from within a mocap file.
This script can be easily utilized to generate markers for a given frame number, but the challenge was to have it generate ALL markers for ALL frames, in a way that we could scrub through on the timeline.
My solution was to use MoCapDB to reference the data file, and for every marker, create a NURBS sphere, then:
1. Store the created sphere in a variable, curSph.
2. Call the position of that marker for the given frame using MoCapDB, then store the XYZ coordinates into variables.
3. Use this information to create keyframes in the translate X, Y, and Z channels.