Warm tip: This article is reproduced from stackoverflow.com, please click
javascript three.js blender

Blender Model and Animation Deformed when Exported for Three JS

发布于 2020-03-27 10:24:23

I am trying to export a model that I made in Blender, so I can use it in a Three.JS project. I have attempted to use both Blender 2.8 GLTF Exporter that comes with 2.8, and Blender 2.79 GLTF Blender IO exporter. Both end up with a similar outcome, depending on what settings I choose when I export.

When I choose "Skinning" as an export option, my animation (Gallop) is applied but my model is deformed. (See pic)

In Blender, I use a simple armature made up of bones, and animate over 20 frames. Nothing crazy, but I'm unsure if there is anything I need to do in Blender before exported to ensure the animation/model remain in tact.

To note, the horse's saddle and pad are separate objects, which I have parented under my Horse armature. I did this because I wanted them to move slightly when the horse gallop animation occurs.

I've attached a few screenshots and my blend file is below. Does anyone have any suggestions to help me get this model exported correctly? (At this point, just getting it to work in the GLTF Viewer is enough)

Horse Blend File

Blender view

Horse model in GLTF Viewer

Questioner
Matthew Corway
Viewed
44
sambler 2019-07-04 12:44

That sort of distortion happens when the location of the armature and mesh are different.

In blender select all and press ⎈ CtrlA->Rotation & Scale

You will find that the saddle and blanket won't be positioned properly, you should add an armature modifier to them so that they follow along with the horse. This would be due to blender using z-up and exporting to a y-up environment (the y-up conversion is an option when exporting).