English 中文(简体)
How to export multiple animations with constraint from Blender? (glTF 2.0)
原标题:

Problem: When exporting to glTF for use in Godot, only the top animation track in the NLA editor is exported correctly. All other animations are broken and misaligned.

misaligned animation

I have three armatures in my project: Gun, Left arm, Right arm. The arms have child of constraint Bone Constraints on them, attaching them to Gun.

I have all animations pushed onto NLA tracks.

NLA Project

Things I ve tried:

  • Exporting each animation individually and combining them later in Godot. Clean animations break upon being pasted into a different AnimationPlayer Node.

  • Baking animations. Not entirely sure what the correct method is, but I ve tried baking in multiple ways, from object and pose mode, by removing and maintaining constraints, by overwriting actions and not, and it either doesn t make a difference or stretches out meshes beyond recognition.

  • Changing export settings. None of them seem to make a difference. "Use Current Frame" must be on.

  • Applying transforms. Well, applying transforms to the meshes does no harm, but nothing changes. Applying transforms to the bones sends them flying to every corner of the 3D view.

  • Clicking Apply on the Child of Constraint modifier. When I do this the object loses all animation.

  • Manually setting keyframes every frame. Does nothing.

  • Exporting without using NLA.

I suspect the Child of Constraint has something to do with how everything gets misaligned, especially considering an earlier project used no such modifier, and exported fine with around 10 unique animations. What I really don t understand is why only one of the animations get exported flawlessly.

I appreciate any and all help! Project Link (google drive)

问题回答

I apologize for being 3 months late, however I went through a near identical issue, and I will post the solution that worked for me regardless for any people who might pass by through google and see this. I was working with Unity and not Godot for this project, though I imagine a lot of this stuff can be carried over to the problem that you have.

My animations were setup like this:

  • The left and right arm were separate objects being controlled by a single armature, and the weapon (a m1911 pistol) was a single object being controlled by a single armature.
  • The right hand was given a "Child Of" constraint to the pistol s root bone, while the left hand was constrained to the pistol s magazine bone.
  • I had one set of animations for the gun armature, and another set of animations for the arms armature.
  • The scale for all of the armatures and respective objects were applied prior to animation.

I managed to properly export ALL of animations to Unity like this:

  • Selecting the arms armature in object mode, switching to pose mode, selecting all bones, and then clicking "Pose" at the top.
  • Under "Animation", clicking "Bake Action".
  • When baking the action, ensuring that "Only Selected Bones" and "Visual Keying" were checked, and that "Clear Constraints"/"Clear Parents" was NOT checked. The other two checkboxes, as well as the start frame, end frame, and frame step settings are up to you to decide. The Bake Data was set to "Pose".
  • After applying the Bake Action, you will immediately notice the animation is not synced. Click on the bones with the "Child Of" Constraints, and set their Influence to zero by dragging the slider all the way to the left or clicking the X next to it. This should fix the issue.

After doing this, try testing if the animation works without the parent bone that the other bones were once constrained to with "Child Of".

If you have multiple actions, then change to the next set of actions you want to bake, set the influence of all "Child of" Constraints back to 1, and repeat the process of baking the action as written above.

To export, I then had each action for each armature as a separate NLA strip (That is, on the gun rig there was a Shooting action strip, a Reload action strip, etc., while on the arm rig there was also a Shooting Action strip, Reload action strip, and so on.)

I then exported with NLA strips into .FBX. this worked like a charm when importing into Unity. I had some duplicate animations coming from the left/right arm objects, but i just deleted those when i noticed them in unity.

Hope this helps somebody. And, if you re reading this, odds are you already found this playlist on youtube, but I ll post it anyway as it contains helpful export advice as well as general FPS animation tips and tricks. https://youtube.com/playlist?list=PLn8ROcXT8fZgjdv4w6FczF8ziXkavUxdu





相关问题
images sliding continuously with <table> and jQuery

I m trying to write a little test page that circulates images through a window (see image). I have colored boxes inside a table (gray border), with each box being a element. <table id="boxes" ...

WPF 3d rotation animations

I have a few 3d rectangles on my screen that I want to pivot around the Y axis. I want to press down with the mouse, and rotate the 3d object to a max rotation, but when the user moves their mouse, ...

Disable Windows 7 touch animation in WPF

In Windows 7 when you touch the screen there is a short animation that occurs at the touch point. In my WPF app I want to display my own touch points, without showing the one supplied by Windows. ...

jQuery block moving

I wanna move a div block to the top, so I coded like this: CSS part: .movingPart{ margin-top:80px; } jQuery part: $(document).ready(function() { $( #btn ).click(function() { $( .movingPart )....

Direct 2D gnuplot PNG animation?

Can anyone please confirm that yes/no Gnuplot 4.5 (on CVS) can output 2D animated PNG files? I have numerous datasets but one line that I d like to show iteratively in 3 different places in my graph. ...

Visual State Manager VS Animations in WPF

There is a lot of talk about the simplicity of Visual States and the transitions between them in WPF/Silverlight. I have the need to generate animations dynamically at runtime, to animate the ...

Create a ImageIcon that is the mirror of another one

I ll like to know if there is a way to create a ImageIcon that is the mirror of another ImageIcon. Searching on Google, I found how to do it by using many AWT libraries. Is there a way to do it with ...

how to drag in the animation in iphone application?

Iphone application is using the static co-ordinates to reach at some points in the application,which is based on the button event. But what i want is when i drag the item than it should reach at some ...

热门标签