<p>You're seeing channels and samplers there, not individual keyframes.  In this case, one animation is simultaneously targeting the translation, rotation, and scale channels of the same node, with three separate "samplers" (sets of keyframes per channel).</p>

<p>Not shown above, your glTF file has a section called <code>accessors</code> that tells viewers how to slice out portions of binary data from an associated <code>.bin</code> file.  The <code>.bin</code> file contains mostly mesh position/normal/UV data, but also contains the keyframe times and values.</p>

<p>So in the above snippet, that first channel targets the <code>translation</code> of node 3 with sampler 0 (the first sampler).  The sampler there asks for <code>LINEAR</code> interpolation of keyframes from animation times (<code>input: 8</code>) for translation keyframe values (<code>output: 9</code>).  In the <code>accessors</code> section, accessors 8 and 9 (using zero-based indexing) are references to the keyframe times (in 8) and values (in 9).  They are separate because the data type of the output depends on what's being targeted (rotations are vec4 quaternions for example, while translations and scales are vec3, and the input times are just floats).</p>

<p>The <code>accessors</code> in question (8 and 9 for example) will contain a value <code>"count"</code> that effectively tells you the number of keyframes.  If you have 5 keyframes for example, accessor 8 should have <code>"count": 5</code> keyframe times, and accessor 9 will also have <code>"count": 5</code> keyframe values.  The glTF Validator will flag an error if these counts don't match.</p>

CC BY-SA 4.0
2018-05-10T05:40:38.740Z
Thank you for the explanation again emackey ! :D Tonight I will check my bin file for the values.
Vettel.Sebastian
CC BY-SA 4.0
2018-05-10T16:05:17.390Z
I realised that it has count 70, not 5. I have 70 frames. Why it's storing my frame datas instead of the 5 keyframes ?? I really need the keyframes, I am so angry now because if it doesn't store the actual keyframes then my one month work will lost...
Vettel.Sebastian
CC BY-SA 4.0
2018-05-10T16:16:22.133Z
https://imgur.com/a/esok5xO as you can see there are 5 keyframes in 70 frames
Vettel.Sebastian
CC BY-SA 4.0
2018-05-15T12:47:12.143Z
The 5 vs 70 keyframe question was [resolved on GitHub here](https://github.com/KhronosGroup/glTF-Blender-Exporter/issues/216).
emackey
CC BY-SA 4.0
2018-05-09T20:44:57.930Z
2018-05-09T20:44:57.930Z
emackey
<p>I have an animated cube with 5 keyframes and when I export it to glTF with blender, in the file I can only see 3 keyframes:</p>

<p><a href="https://i.sstatic.net/Ep6Jc.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ep6Jc.jpg" alt="enter image description here"></a> </p>

<p>But when I viewed the gltf model with viewer all 5 keyframes worked well in the animation. Whats the explanation of this ? 
My blend file if you are interested: <a href="https://files.fm/u/ujs4w23g" rel="nofollow noreferrer">https://files.fm/u/ujs4w23g</a></p>

<animation><gltf>
glTF animation keyframe question
Vettel.Sebastian
# glTF animation keyframe question

(Asked by: username_0 on 2018-05-09)

I have an animated cube with 5 keyframes and when I export it to glTF with blender, in the file I can only see 3 keyframes:

[![enter image description here](https://i.sstatic.net/Ep6Jc.jpg)](https://i.sstatic.net/Ep6Jc.jpg)

But when I viewed the gltf model with viewer all 5 keyframes worked well in the animation. Whats the explanation of this ?
My blend file if you are interested: <https://files.fm/u/ujs4w23g>

**Tags:** animation, gltf


---

## 1 answers

### Answer by username_1 on 2018-05-09. Score: 3 | Accepted answer

You're seeing channels and samplers there, not individual keyframes. In this case, one animation is simultaneously targeting the translation, rotation, and scale channels of the same node, with three separate "samplers" (sets of keyframes per channel).

Not shown above, your glTF file has a section called `accessors` that tells viewers how to slice out portions of binary data from an associated `.bin` file. The `.bin` file contains mostly mesh position/normal/UV data, but also contains the keyframe times and values.

So in the above snippet, that first channel targets the `translation` of node 3 with sampler 0 (the first sampler). The sampler there asks for `LINEAR` interpolation of keyframes from animation times (`input: 8`) for translation keyframe values (`output: 9`). In the `accessors` section, accessors 8 and 9 (using zero-based indexing) are references to the keyframe times (in 8) and values (in 9). They are separate because the data type of the output depends on what's being targeted (rotations are vec4 quaternions for example, while translations and scales are vec3, and the input times are just floats).

The `accessors` in question (8 and 9 for example) will contain a value `"count"` that effectively tells you the number of keyframes. If you have 5 keyframes for example, accessor 8 should have `"count": 5` keyframe times, and accessor 9 will also have `"count": 5` keyframe values. The glTF Validator will flag an error if these counts don't match.

> **Comments:**
> **username_0**: Thank you for the explanation again username_1 ! :D Tonight I will check my bin file for the values.  
> **username_0**: I realised that it has count 70, not 5. I have 70 frames. Why it's storing my frame datas instead of the 5 keyframes ?? I really need the keyframes, I am so angry now because if it doesn't store the actual keyframes then my one month work will lost...  
> **username_0**: https://imgur.com/a/esok5xO as you can see there are 5 keyframes in 70 frames  
> **username_1**: The 5 vs 70 keyframe question was [resolved on GitHub here](https://github.com/KhronosGroup/glTF-Blender-Exporter/issues/216).  

---

