带有骨骼动画(搅拌机导出)的模型在three.js 中动画不正确 [英] Model with bones animation (blender export) animating incorrectly in three.js

查看:19
本文介绍了带有骨骼动画(搅拌机导出)的模型在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-演示: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-搅拌机导出骨骼动画/

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

To summarise, the most important things I found were:

导出前删除Armature Modifier,否则动画会全乱.

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天全站免登陆