Maya Analysis and Visualization : Working with joint coordinate systems (JCS)
Last updated
Last updated
Click jAx on the XROMM shelf or type jointAxes in the MEL box. The following window will open:
in your Maya scene or Hypergraph Hierarchy, select the "proximal object" (the reference bone). The name of the bone will appear in the box. Click Insert Selection button.
select the "distal object" The name of the bone will appear in the dialog box. Click Insert Selection button.
Name your axis system. Click Create Axes. If this button does not become available when you type in a joint name, hit enter. Select create Axes without Locators (create axes with locators is more specialized). A set of orthogonal axes will appear in the main Maya window and an object with yourjointname will appear on the hypergraph.
Use Maya object rotation and translation tools to align axes to the expected movement. The z-axis (blue) should be set as the axis with the largest expected rotation, and the y-axis (green) as the second largest expected rotation.
The right-hand rule determines the polarity of rotations. Aim thumb along axis arrow direction; fingers curl in positive rotation direction.
The z-axis (blue) may have default positiveZ and negativeZ locators and aim and point constraints. The locators can be used to intersect the Z-axis with specific anatomical landmarks. If you do not want to use the locators, then they should be deleted. Go to hypergraph and select and delete the positiveZ and negativeZ locators. The point constraint and aim constraint objects should automatically be deleted as well.
click SetJointAxes button on the AnatomicalJointAxes window
a new object will appear on the far right of the hypergraph named (yourjointname)data
if the graphing window does not appear automatically, go to Window/Animation Editor/Graph Editor
Select the Data type, coordinate system, and whether or not the selected object has animated data.
Select header options for your file. Note: if you choose to remove frame spacing with NANs, row headers will automatically be selected to help keep track of what frames you have exported.
Unless you wish to only export keyframes, keep spline interpolate selected.
Export all keys, keys on the timeslider, or a selected range of data.
Click export and save data in appropriate location.
(Note: an easier solution to this problem is to concatenate all xyz points from each individual into one file and then calculate rigid bodies. The resulting animation will have all of your trials in it. Set the JCS once and output data for all trials in the same coordinate system).
In order to reduce variation in anatomical axis placement on the same individual, it is useful to use the same anatomical axis system for all trials (sequences) from the same individual. After you have created an animation with the anatomical axis system you want, Save it and then use Save As to create a copy of the scene, call it something like "axes_Setup_scene" and do the following:
Select one of the animated bones. In the channel box, highlight (select) all six animation parameter names from "TranslateX" to "RotateZ". Right click and select "Break connections". This deletes the key frames for that bone.
Next, highlight the numbers next to TranslateX through RotateZ and set them to zero. This moves the bone back to the CT (bone scan) coordinates where it started.
Do the same for all of the the other animated bones.
Delete the old Joint_data from the previous anatomical axis animation (the animated node in the hierarchy with the name of the joint). Do not delete the axes on the bones or the locators.
Save this Setup Scene and then Save As the name of the next sequence that you want to animate and measure.
Import your new animation data, as usual.
Click the "jAx" button on the XROMM tool shelf (or type jointAxes in the MEL command box). Put in the same proximal and distal bones that you used before. Use exactly the same Axes Name for the joint as you did before (important). Do not click the "Create Axes" button (because the axes with Axes_name already exist).
You should be able to click the "Set Joint Axes" button now. This will recalculate the rotations and translations for the new animation in the old anatomical axis system. Save this scene.
Select the object(s) you wish to export data from (for JCS: yourJointName_data node in Hypergraph hierarchy), and press the “exp” button on the XROMM tool shelf or type expdata into the Mel command line. This window should pop up: