在Three.js中带有骨骼动画(混合器导出)的动画制作错误的模型 [英] Model with bones animation (blender export) animating incorrectly in three.js

查看:467
本文介绍了在Three.js中带有骨骼动画(混合器导出)的动画制作错误的模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在Three.js中进行骨骼动画测试.我有一个简单的模型,可以在搅拌机中制作动画.基本上,它由三个堆叠的弯曲立方体组成.

I am currently working on skeletal animation tests in three.js. I have a simple model which animates just fine in blender. Basically it consists of three stacked, bending cubes.

当我使用带有Blender V2.64的blender导出插件将blender文件导出到three.js时,webGl上下文中的动画看起来像皮肤权重错误一样.

When I export the blender file to the three.js using the blender export plugin with Blender V2.64, the animation in the webGl context appears different as if the skinweighting is wrong.

WebGL-Demo: http://rainbowrangers.de/threejs/animation_test01/

WebGL-Demo: http://rainbowrangers.de/threejs/animation_test01/

混合器文件: http://rainbowrangers.de/threejs/animation_test01/model/animation_test01.blend

我该怎么做才能在three.js中获得正确的结果?

What do I have to do to get the correct result in three.js?

推荐答案

我是您在github讨论中引述的人.我最近一直在尝试使用此管道(即将Blender骨骼动画转换为threejs),并且发现很难找到一个每次都能运行的可靠过程.

I am the person you quoted from the github discussion. I have recently been experimenting with this pipeline, ( ie Blender bone animations into threejs,) and have found that it is very very difficulty to find a reliable process that will work every time.

在我的博客上,我整理了一个提示"列表,这些列表使我在某些情况下获得成功:

On my blog, I have compiled a list of 'tips' that allowed me to achieve success on some occasions:

http://dev.mothteeth.com/2012/10/threejs- blender-exporting-skeletal-animations/

总而言之,我发现的最重要的事情是:

To summarise, the most important things I found were:

在导出之前删除电枢修改器,否则动画将被弄乱.

Delete the Armature Modifier before exporting, or the animation will be all messed up.

检查是否已将顶点组"正确分配给骨骼. (在Blender中,您可以使用自动骨骼重量.)

Check that your Vertex Groups are properly assigned to the bones. ( In Blender, you can use automatic bone weights. )

在动画的第一帧和最后一帧中锁定所有骨骼. (正如您所发现的,如果您仅拥有已更改骨骼的键,ThreeJS将不会推断其他骨骼的任何东西,并且事情将会被破坏.)

Key all bones in the first and last frames of your animation. ( As you discovered, if you only have keys for the bones you have changed, ThreeJS won't infer anything about the other ones, and things will be broken. )

即使遵循这些准则,我也无法使事情始终如一地工作,并且一直在考虑使用变体目标,直到库更成熟为止.根据我的经验,变形目标的文件大小要大得多,但目前看来,这是一个更可靠的选择.

Even following these guidelines, I can't get things to work consistently, and have been considering using morph targets until the library matures a bit more. The file sizes for morph targets are much larger but they seem to be a more reliable option at this point, in my experience.

这篇关于在Three.js中带有骨骼动画(混合器导出)的动画制作错误的模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆