x3d-base humanoid animation

Last updated: 5/9

This is the dev log page for animating humanoid.
credits: the original Filmbox format humanoid models, and animations used in this prototype are all from mixamo.com

characters
Models used:
Paladin w/Prop J Nordstrom (removed sword and shield for prototyping)
X bot
animations
Animations used: Jumping
Start Walking (standing to start walkingwith rifle)
Samba Dancing (Olodum Variation two)

Current stage: prototyping (.fbx to .x3d)
Considering the main body mesh only; directly incorporating additional meshes (e.g. helmet, object held in hands)
may result in unexpected displacement

resource and conclusion board

newest update: resources avalible here
seperated files
blender python script to export index groups and weights
TODO: script to auto generate final X3D file
exported index groups and weights example
example in x3d (with animation bugs)
mesh skin picture

integrated final result
here

for more resources, visit this directory

static result, spr 2019
somba
animated result, spr 2019
somba
(The helmet at line 410, although not places precisely, can be added for interpolator correctness check)


issue board-current unsolved issues, require future effort:
complain of mesh weight by Okino when exporting from dae
issue found: complain of mesh weight by Okino when exporting from dae
4/24 retrying prototyping with a simpler instance, and export with .c4d to .x3d in Okino (dribbling, paladin with no shield/sword).
download c4d to x3d export
download dae to x3d export
default X3DOM JS library/stylesheet cannot render humanoid correctly, as shown here
maybe try X_ITE

guesses, concolusions, and suggestions:
1. "localsystem = true" is a highly rare case, which suggests that the pipeline: Mixamo -> blender -> Okino is not ideal
2. confirmed that Okino conversion step adds trivial new vertices: original count 7093, after conversion count 7096 (0 - 7095);
This 1) will result in unmapped vertices on mesh, even after incorporating all blender exported vertex information; current fix: simply add the extra vertices to the end of the original last vertex's vertex group with weights of 1. e.g. In paladin's case, add to the left foot HAnimjoint "skinCoordIndex" and "skinCoordWeight" fields (line 112, example in x3d).
before fix:
somba
2) could be a partial reason for the deform of mesh when incorporating animation.
3. from the animation with helmet added, the position and rotation interpolators appear to be correct, which suggests that the current issues may be a sole result of bad mapping in the HanimHumanoid node.

current pipeline

Pipeline step 1: export from blender in .fbx format

The process of combining skeletons and mesh to produce and export an animated .fbx model through blender can be found (in example, a paladin, multiparts) here
Short summary: Blender does not support .x3d animation import/export, so .fbx format is adopted for intermediate result.

Note: currently ignoring the sub parts: helmet, shield, and sword for simplicity and debugging;
Report: blender .dae format export issue symptom.
1. Operator Presets, sim rigged setting: distorted export unreadable by instant reality
2. Operator Presets, static setting: static mesh without skin readable by instant reality
3. Operator Presets, sim rigged setting with material mapping instead of UV mapping: static mesh with skin readable by instant reality
4. Operator Presets, with any other selection combination under "export data settings": distorted export unreadable by instant reality

Pipeline step 2: converting to intermediate .x3d file

Used Okino for conversion:
.fbx to .x3d did not produce animated result;
.fbx to .dae produced corret result, then to .x3d produced unanimated mesh detached from animated, invisible rigs; the .fbx blender export, .dae okino export, and .x3d okino export are avalible here

somba somba_d

An alternate example (simple humanoid dancing somba, same issue) is avalible here

somba somba_d
Try of other convertion tools; not confirmed ones marked with red:
3d obj converter taks no .fbx/.dae
AC3D does not export .x3d
CMake: confusing ui
FME: T-pose .x3d and .dae export with instantplayer; unreadable by "server"
MeshLab: does not support animation import/export
Paraview: reads OBJ file, which is static
SeamLess 3D, Seg3D: cannot import
Vivaty: license issue? Could not open
Unity: need to confirm


Pipeline step 3: fixing intermediate .x3d file

The resulting .x3d file from step 2
1. uses transforms and interpolators instead of HanimHumanoid node
2. detaches skeleton parts from meshes
Current approach: directly converting the transform node for the skeleton to HanimHumanoid node, attach the mesh as skin, and extract vertex indexes and weights from blender for each corresponding vertex group to animate the model.

The code snippets for extracting vertex number and weight information can be found in the resources at top.

Naive efforts to incorporate HanimHumanoid into the step 2 result (paladin): here.

IMPORTANT: to correct the animation, add
localCoordSystem = "true"
to the root HAnimHumanoid node after this step.