Scientific Rotoscoping : Animating a Bone with One or Two Markers
Last updated
Last updated
If there are only one or two markers in a bone, you can still reconstruct 3D movement of the bone by combining marker-based and markerless (Scientific Rotoscoping) techniques. If other bones have 3 or more markers, you can simply animate those bones by following instructions for marker-based data (link).
Save your current Maya scene as your skeleton setup scene.
In the skeleton setup scene, calculate the marker centroids for each marker using the vAvg shelf tool. Be sure to use the same marker number(s) as in your digitized data. You do not need to export the CT marker centroid data.
Parent the bone that you want to position to the locator (created by the vAvg marker centroid calculations) of the marker you want to use to position the bone. Do this by first selecting the bone, then shift+selecting the marker centroid locator, and then select Edit -> Parent (or press 'P').
To prevent accidentally moving the bone relative to the marker, select the bone model and then select the translate, rotate and scale channels in the channel box. Right click and select “Lock selected”.
Your bone should now be a child of the marker centroid locator, and the bone’s translations and rotations should be locked. Save your skeleton setup scene and close it.
Create a new locator (Create -> Locator) and name it controlParent. Then create a duplicate of controlParent by selecting the controlParent locator and select Edit->Duplicate. Name the newly duplicated locator controlChild and parent it under controlParent (select controlChild, then controlParent, then Edit->Parent).
Create a point constraint. Shift+select the two marker centroid locators (created by the vAvg marker centroid calculations) being used to position the bone. Then shift+select controlParent (all three locators should now be selected, with controlParent last). Under the Animation menu set, choose Constrain -> Point. Make sure that under Point Constraint Options (click on square to right of Point in Constrain menu), the “Maintain offset” box is unchecked.
Create an aim constraint. Select ONE of the marker centroid locators being used to position the bone; it does not matter which one. Then shift+select controlParent (two locators should now be selected) and choose Constrain->Aim.
Select controlChild and figure out which rotation (X, Y, or Z) spins about the axis between the two markers. Do this by selecting controlChild and using the Rotate Tool to rotate each axis independently. When you have determined the correct rotation axis, return all controlChild translations and rotations to zero (use the channel box). Select the other two rotation axes and lock by selecting them in the channel box, right-clicking, and selecting “Lock selected”.
Parent the bone model under controlChild. Your hierarchy should now look like this:
Save your skeleton setup scene and close it.
Create an animation scene by importing both x-ray cameras and loading the undistorted video on the appropriate cameras.
Reference the skeleton setup scene by Choosing File-> Create Reference and navigate the skeleton setup scene you wish to use.
Select the marker centroid locator that is the parent of the bone model you are animating. You should have digitized data (xyzpts.csv file) for this marker.
Type impOneMarker (your marker number here) in the MEL command line. For example, if your marker centroid locator is “m001”, type impOneMarker(001). This, like all MEL commands, is case-sensitive. A dialog box will open, allowing you to select your digitized data (xyzpts.csv) file.
The previous step will “pin” your bone model to the digitized position of the selected maker and set keyframes on the Translate X, Translate Y, and Translate Z channels. Tip: If your bone model does not appear to move to its digitized position, move to a different frame of the animation. Changing the frame seems to "refresh" the animation, and the bone will appear in its proper position in all frames.
Now you can select the marker centroid locator and use the rotation tool to properly orient the bone according to the x-ray video images. You are now ready to rotoscope your bone (see instructions for using the Pan and Scan tool). The only differences from markerless rotoscoping is that
you only need to manipulate rotations to align the bone model and
Select the two marker centroid locators. You should have digitized data (xyzpts.csv file) for these markers.
Type impTwoMarker (marker1 number, marker2 number) in the MEL command line. For example, if your marker centroid locators are “m001” and “m002”, type impTwoMarker(001, 002). This, like all MEL commands, is case-sensitive. A dialog box will open, allowing you to select your digitized data (xyzpts.csv) file. Be sure that you enter your marker numbers in the same order that you selected the locators. For example, if you selected centroid locator 001 and then centroid locator 002, you should type impTwoMarker(001,002).
The position and orientation of controlParent locator (and thus the bone model) will be dictated by the position of the two markers. Tip: If your bone model does not appear to move to its digitized position, move to a different frame of the animation. Changing the frame seems to "refresh" the animation, and the bone will appear in its proper position in all frames.
you will be changing the rotations of the marker centroid locator, not the bone model itself.
You should now be able to align the bone model to the x-ray video images by rotating the controlChild locator about its single unlocked rotation. The only differences from markerless rotoscoping is that 1) you only need to manipulate a single rotation to align the bone model and 2) you will be changing the rotations of the controlChild locator, not the bone model itself.