1
$\begingroup$

I imported a glTF file in blender that has a model & armature (no animations) Then I created a very simple animation (Just 2 keyframes) where i only rotated a bone and then exported to glTF. After that I checked the channels of the animation and saw that targets included 'translation' and 'scale' paths even though the animation only consisted of rotating a bone, why is that? the translation I can maybe understand(perhaps it sets the rotation origin for each bone, just a guess though) but scale makes no sense(I also checked the scale values and all of them are 1.0, 1.0, 1.0 or 1.0, 0.9999994, 1.0 etc) what I expected was only targets with the 'rotation' path

Blender file:

Update: It seems like disabling "Always sample animations" fixes this (it also only exports the keyframes I created instead of all the inbetween ones as well) as for why this works I'm not sure yet.

$\endgroup$
16
  • 1
    $\begingroup$ You may have only rotated the bone, but your blend file shows that you actually set the keyframes for location, rotation and scale so that's what got exported! How did you actually set the keyframes in Blender? Pressing 'I' and selecting 'Rotation' from the popup menu just adds the rotation keyframes. $\endgroup$
    – John Eason
    Nov 27, 2021 at 23:48
  • $\begingroup$ I used the 'record' option then selected the keyframe and used the 'rotate' gizmo to rotate the bone. $\endgroup$
    – Suic
    Nov 28, 2021 at 0:08
  • 1
    $\begingroup$ The 'record' option will always create keyframes for location, rotation and scale even if location and scale haven't changed! That's why I said use the 'I' key to save just the keyframes you need. You can also save just a single keyframe if (for instance) you've just moved the X location by right-clicking the changed value and selecting 'Single keyframe' in the popup menu. $\endgroup$
    – John Eason
    Nov 28, 2021 at 0:32
  • 1
    $\begingroup$ @Suic What Blender version are you testing with? Like I said, it works for me in current Blender 3.0, but it will not work in 2.93 or earlier. $\endgroup$
    – scurest
    Nov 28, 2021 at 3:41
  • 1
    $\begingroup$ Glad you found the answer! Hopefully that will be fixed in 2.93.7 since bugs are still being fixed in that version. $\endgroup$
    – John Eason
    Nov 28, 2021 at 17:09

1 Answer 1

0
$\begingroup$

It turns out that this is an issue present in blender 2.93.6 and is fixed in Blender 3.0(RC) the 'fix(that worked for me)' in 2.93.6 was to disable 'Always sample animations' when exporting to glTF.

$\endgroup$
6
  • $\begingroup$ Be very careful disabling that. The animation system in glTF does not match 1:1 everything that Blender's animation system does. In particular, the way rotations are interpolated in glTF can be quite different from Blender's rotation interpolation options. That's why the default was chosen to be "Always sample," it writes more data into the file but it more faithfully reproduces the intended animation. $\endgroup$
    – emackey
    Nov 28, 2021 at 19:28
  • $\begingroup$ oh i was not aware of that, what exactly does the "Always sample animations" do? @emackey $\endgroup$
    – Suic
    Nov 28, 2021 at 19:30
  • $\begingroup$ Essentially it "bakes" the animations, turning every frame into a keyframe, applying linear interpolation between them. Complex curves can be approximated and reproduced even on systems that don't offer Blender's flexible animation options. $\endgroup$
    – emackey
    Nov 28, 2021 at 19:33
  • $\begingroup$ I see, well in blender 3.0(RC) i have that option toggled on and it works properly now(doesn't export translation/scale keyframes if i only have rotation ones) it also by the looks of it exports the keyframes that were actually affected instead of keyframes for every single bone(which did happen previously) $\endgroup$
    – Suic
    Nov 28, 2021 at 19:38
  • 1
    $\begingroup$ If you need to, CLI tools can remove the unneeded keyframes after export. Example: gltf-transform resample input.glb output.glb(docs) $\endgroup$ Nov 29, 2021 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .