当导出为GLTF时,为什么搅拌器绑定的动画会变形? [英] Why is blender rigged animation distorted when exported as GLTF?
问题描述
我在Blender中使用电枢装配创建了动画.当我通过按Alt-A在Blender中对其进行测试时,它的工作原理非常好.但是,当我使用KhronosGroup GLTF导出器将其导出为.glb
时,生成的动画会失真(例如,肢体断开并以奇怪的方式移动).
为什么会这样(我该如何解决)?
在过去的两天里,我一直在尝试解决类似问题的解决方案(例如,使用Ctrl-A应用位置/旋转/缩放,或删除网格上的骨架"修改器),但没有一个对我有用./p>
链接:
这里是指向动画外观的屏幕录像的链接(这是我在Blender中播放的动画): https://github.com/kylejlin/托管我的堆栈溢出问题/blob/master/correct-animation.mov
这里是指向动画实际外观的屏幕记录的链接(这是我使用Three.js在浏览器中测试导出的.glb
):
https://github.com/kylejlin/托管我的堆栈溢出问题/blob/master/distorted-animation.mov
这是.blend
文件:
https://github.com/kylejlin/为我的堆栈溢出问题托管/blob/master/soldier.blend
这是导出的.glb
文件:
https://github.com/kylejlin/为我的堆栈溢出问题托管/blob/master/soldier.glb
我进一步研究了您的设置..我看到您有一些IK骨骼在部分程度上驱动了动画.这些将无法正确转换,并且必须将IK烘焙到动画中.我还研究了mirror修改器并在那里实现了问题..要导出要镜像的对象,您必须单击应用修改器"复选框,但是ALSO也会应用衔铁"修改器,这会使网格变形,因此您得到了错误的网格出去.要解决此问题,您必须在Blender中手动应用mirror修改器,然后在未选中"apply Modifys"的情况下导出.完成此操作后,将IK烘焙到动画中,就可以使它正常工作.
我过去曾经做过IK烘焙,但是忘记了它是如何工作的,但这是一个起点: https://drive.google.com/open?id=1zeA-mMirOWYZHlzdURqNnykgh_g10kbr
I created an animation in Blender with armature rigging. When I test it in Blender by pressing Alt-A, it works perfectly fine. However, when I export it as a .glb
using the KhronosGroup GLTF exporter, the resulting animation is distorted (e.g., limbs are disconnected and moving in a weird way).
Why is this happening (and how can I fix it)?
For the past two days, I have been trying solutions from similar questions (such as applying location/rotation/scale with Ctrl-A, or deleting the Armature modifier on the mesh) but none of them have worked for me.
Links:
Here is a link to a screen-recording of what the animation should look like (this is me playing it in Blender): https://github.com/kylejlin/hosting-for-my-stackoverflow-questions/blob/master/correct-animation.mov
Here is a link to a screen-recording of what the animation actually looks like (this is me testing the exported .glb
in the browser with Three.js):
https://github.com/kylejlin/hosting-for-my-stackoverflow-questions/blob/master/distorted-animation.mov
Here is the .blend
file:
https://github.com/kylejlin/hosting-for-my-stackoverflow-questions/blob/master/soldier.blend
Here is the exported .glb
file:
https://github.com/kylejlin/hosting-for-my-stackoverflow-questions/blob/master/soldier.glb
I looked at your setup a bit more.. I see you have a few IK bones that are partially driving the animation. Those won't translate correctly, and will have to have the IK baked into the animation. I also investigated the mirror modifier and realize the problem there.. to get the mirrored object to export, you have to click the "apply modifiers" checkbox, but that ALSO applies the Armature modifier, which distorts the mesh so you get the wrong mesh out. To fix that you have to apply the mirror modifier manually in blender, then export Without "apply modifiers" checked. Once you do that, and once you bake the IK into the animation, you might get it to work.
I've done the IK baking in the past but forget exactly how it works, but here's a starting point: https://blenderartists.org/t/bake-ik-to-fk/587226
fwiw Here is the .glb when I pre-applied the mirror modifier.. notice the arms animate correctly now, but the legs/feet are still screwy because of the IK. I didn't figure out how to bake that yet...
https://drive.google.com/open?id=1zeA-mMirOWYZHlzdURqNnykgh_g10kbr
这篇关于当导出为GLTF时,为什么搅拌器绑定的动画会变形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!