-
Notifications
You must be signed in to change notification settings - Fork 33
Creating Rigged Hands
Create a mesh in Maya. It should be Y-up and in units of mm.
The bone structure currently should be four bones per finger, with the end bone being on the tip of each finger. This will be changing soon to allow five-bone fingers, to match the latest skeletal bones API. These metacarpal bones are stationary for now, but may be dynamic in future version of the Leap Motion Software.
The bones should match exactly the aspect ratio and proportions of Leap data. Internally, the LeapJS Rigged Hand uses relative rotations between joins to set the joint positions. If joints are offset, there will be visual discrepancies, such as a pinch appearing with thumb and forefinger in the wrong positions.
Joint initial rotation does not matter, but when the joints are zeroed, they should all point in the same direction as each-other and the palm (See hand.direction
from the Leap API).
The hand should be positioned with the palmPosition
point directly over the origin of the scene in Maya. This is half way between and slightly below the index and middle finger mcp (metacarpal-proximal) joints.
The hand should be pointing in the negative-Z direction, as it will when being used in Leap-space.
When available, we will provide the finished fbx
model and a blank/template with bone positions and orientations for custom-hand creation.
The hand mesh must be brought from Maya to THREE.js complete with rigging-- skinIndices and skinWeights. This is non-trivial, as there are several possible import paths, several model file formats (fbx, obj, dae), and several THREE.js file formats (scene, object, etc).
Chosen because Blender is able to export with Rigging, whereas other components (such as the python script found in the THREE.js repo) export scenes without rigging.
1: Export Maya as DAE_FBX
, using pretty much the default settings. Make sure that the skin is weighted, and that there is only one continuous mesh. Do not use fbx with Blender, as it will not import bones as of v2.70.
2: Import in to blender using Import -> DAE
. Make sure that the import units
box is checked, as it is not by default. The hand mesh should appear large enough to be immediately visible. Delete the cube that Blender creates by default.
3: Export from blender using THREE.js exporter. Save this as untitled.js
in your home directory, as filenames and extensions are ignored and default directories are forgotten. Anything else will drive you insane.
4 (optional): Confirm that the export worked and you're using the correct file format. There should be JSON blob describing the material with vertices, faces, etc. Importantly, skinIndices
and skinWeights
should be present and nonzero, or the mesh will not appear.
5: Use the model. Copy to src/models/your_model.js
. Wrap the JSON file contents with a variable definition, .e.g.: var rigs = {}; rigs.left = {<your json>};
. Be sure to include the semicolon at the end.
Leap Developers — API Docs — LeapJS — Plugins — GLMatrix