three.js: Broken blender export with animation (demos and blends are provided)

Description of the problem

PR #8412 updated blender export and now there are no way to export mesh with skinned animation. I have tested with women model and with monster model, which is imported from collada examples/models/collada/monster/monster.dae. I have build demos with the same main.js but with different json files.

Demos

Settings for mesh export (Scene is unchecked, using THREE.JSONLoader):

Image of settings

Only mesh with new export - women (4MB)

Image of Women Mesh New

Only mesh with old export - women (4MB)

Image of Women Mesh Old

Only mesh with new export - monster (242KB)

Image of Monster Mesh New

There is another option and another problem: export with checked “Scene” and using THREE.ObjectLoader: Image of settings But with this option animation does not work correctly in both versions:

Scene with new export - monster (285KB) Scene with old export - monster (284KB) Image of Monster Scene

I have worked with old exporter and noticed that vertices values in json are bigger with Scene checked then with unchecked version. I have tried to replace this array in json file and animation becomes work properly. I can not figure out what is the problem with exporter with checked Scene.

Files

Exports have been done with reset transforms of bones before each export.

Three.js version
  • Dev
  • r75
Browser
  • Chrome
  • Firefox

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 39 (24 by maintainers)

Most upvoted comments

FYI I’ve tested both of the OP models (monster.blend and women.blend) with the glTF Blender exporter and the results work in THREE.GLTFLoader correctly. Might need some tweaks on your materials to match the PBR workflow glTF uses, but the animation looks right.

001a1cdf-9a58-4844-a1af-0f5761897d39-92650-0000f3cdeeca3115

Hi, by exporting the marine model from Blender: (examples/models/skinned/marine/marine_anims_core.blend folder) there are no errors but nothing appears (the original json works perfectly), so after a little compare of the two files I modified the json file in the material section like below. I exported the model with the parameters as in the image and the model in ‘TPOSE’ position and the export has been successful. Hope it may be useful.

Parameter modified: “materials”:[{ … “blending”:“NormalBlending”, (removed this line) “color”:16777215, (was 8947848) “transparent”:false, (was true) … }],

three r85 master blender 2.78c safari / chrome browser

threejs_export_params

I just want to throw some advice to people having animation export probs… Generally try to keep all your objects in identity transforms as much as possible… i.e. no rotation , position set to 0 and scaling to 1…

Then do your armature binding/skinning…

then with the skin selected, do the export.

Another tip, when you hit the save settings button at the bottom of the export pane, you then also have to save the blend file, or the settings wont actually save.

@trumanus If you haven’t been exporting from the bind pose that’s another reason you get the Nightmare Dragon. Make sure you try that.

The bind pose is important because there has to be a starting transform for all verts and bones from which to transform. For example, if you move the right arm up, what does that mean? It needs to know what the starting point of the verts are so it can know where to move them when the arm goes up.

So If the bind pose is wrong, the starting point for your animation is wrong.

Hey guys. I did some work on the skinned mesh export recently because we couldn’t get any skinned meshes to work at all.

Is your skinned mesh scaled in Blender? If so, try Applying the Transformations of both Rotation and Scale. That usually fixes the “nightmare dragon” problem (that’s what we call it when the mesh distorts like that.