<p>I'm working on a glTF, precisely I'm trying to animate a &quot;static&quot; mesh exported from Blender directly acting on its JSON.
In doing so, I'm following the logic used in this <a href="https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_006_SimpleAnimation.md" rel="nofollow noreferrer">tutorial</a> , where a triangle is animated adding a new buffer, containing only data regarding time and rotation coordinates. Along with the new buffer, also the animations array, the bufferviews related to the new buffer, and the new accessors are added to animate the initial static <a href="https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_003_MinimalGltfFile.md" rel="nofollow noreferrer">triangle</a> .</p>
<p>Right now, I'm trying to animate a plane, working on the <a href="https://github.com/Ludovicolin/LL/blob/main/STATIC_PLANE.JSON" rel="nofollow noreferrer">input JSON</a> obtained by simply creating the plane in Blender and exporting it in the glTF format. Using the same data URI seen in the previously mentioned tutorial regarding the rotating triangle:</p>
<p>{
&quot;byteLength&quot;: 100,
&quot;uri&quot;: &quot;data:application/octet-stream;base64,AAAAAAAAgD4AAAA/AABAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAPT9ND/0/TS/AAAAAAAAAAAAAAAAAACAPw==&quot;
}</p>
<p>I've been able to apply successfully that rotation to the <a href="https://github.com/Ludovicolin/LL/blob/main/DYNAMIC_PLANE.JSON" rel="nofollow noreferrer">plane</a> .</p>
<p>The problem is that, always following the same logic, I'm having hard times in creating animations different from the one that is used in the tutorial so, basically I'm having problems in creating data URI containing information about time and animation.
The procedure I'm using in creating those data URIs, consists of writing times and coordinates in a file saved with no extension (to have a generic binary data application/octet-stream) , and then converting this file in a data URI with an <a href="https://www.adminbooster.com/tool/data_uri" rel="nofollow noreferrer">online converter</a> .</p>
<p><a href="https://github.com/Ludovicolin/LL/blob/main/TIME+COORDINATES" rel="nofollow noreferrer">Here</a> you can see how I write the file to be converted in data URI that contains coordinates and time, and <a href="https://github.com/Ludovicolin/LL/blob/main/1B_TRANSLATION_PLANE.JSON" rel="nofollow noreferrer">here</a> you can see how the translation written in previous link doesn't work in the initial glTF of the plane. I suppose the error is the way i write the time and coordinates. How should I write those coordinates and time to be converted in data URI to be properly read and executed by the glTF?</p>
<p>I've even tried to separate time and coordinates by creating two different buffers, one referring to time and one referring to animation, to avoid the problem of making mistakes in setting the byteOffset property in the accessors referring to animation and time.
<a href="https://github.com/Ludovicolin/LL/blob/main/2B_DYNAMIC_TRANSLATION_PLANE.JSON" rel="nofollow noreferrer">Here</a> you can see the code of a translation applied to the same plane using the two new buffers referring to time and translation.<br />
The structure of the starting file, later converted in data URI, containing information regarding time follows:</p>
<p>(0.0),<br />
(0.25),<br />
(0.5),<br />
(0.75),<br />
(1.0)</p>
<p>The structure of the starting file, later converted in data URI, containing the translation coordinates follows:</p>
<p>{ 0.0, 0.0, 0.0 },<br />
{ 2.0, 0.0, 0.0 },<br />
{ 6.0, 0.0, 0.0 },<br />
{ 6.0, 2.0, 0.0 },<br />
{ 8.0, 4.0, 0.0 }</p>
<p>Thanks in advance for your help :)</p>

CC BY-SA 4.0
2022-11-17T15:21:03.120Z
"*directly acting on its JSON*" What does that mean? Blender doesn't have any JSON in it. GLTF is something that Blender exports. Do you mean that you want to export a series of meshes each containing the post-animation vertex data for a particular frame? That is, you want to convert Blender animation into vertex animation? This seems to be a question more about Blender3D than GLTF.
Nicol Bolas
CC BY-SA 4.0
2022-11-19T07:17:32.693Z
As Nicol Bolas already mentioned, this question seems to be more about Blender. There is a StackExchange Community only for Blender ([link](https://blender.stackexchange.com/)). You might get a more detailed and faster response there. If you want to ask your question on this site, please read their help pages first and delete your question here since we want to avoid cross-site duplicates.
wychmaster
<3d><animation><buffers><gltf><blender>
Starting from a basic glTF (such as a static sphere or plane) exported from Blender how can I add an animation manipulating its JSON?
Ludovico
# Starting from a basic glTF (such as a static sphere or plane) exported from Blender how can I add an animation manipulating its JSON?

(Asked by: username_0 on 2022-11-17)

I'm working on a glTF, precisely I'm trying to animate a "static" mesh exported from Blender directly acting on its JSON.
In doing so, I'm following the logic used in this [tutorial](https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_006_SimpleAnimation.md) , where a triangle is animated adding a new buffer, containing only data regarding time and rotation coordinates. Along with the new buffer, also the animations array, the bufferviews related to the new buffer, and the new accessors are added to animate the initial static [triangle](https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_003_MinimalGltfFile.md) .

Right now, I'm trying to animate a plane, working on the [input JSON](https://github.com/Ludovicolin/LL/blob/main/STATIC_PLANE.JSON) obtained by simply creating the plane in Blender and exporting it in the glTF format. Using the same data URI seen in the previously mentioned tutorial regarding the rotating triangle:

{
"byteLength": 100,
"uri": "data:application/octet-stream;base64,AAAAAAAAgD4AAAA/AABAPwAAgD8AAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAD0/TQ/9P00PwAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAPT9ND/0/TS/AAAAAAAAAAAAAAAAAACAPw=="
}

I've been able to apply successfully that rotation to the [plane](https://github.com/Ludovicolin/LL/blob/main/DYNAMIC_PLANE.JSON) .

The problem is that, always following the same logic, I'm having hard times in creating animations different from the one that is used in the tutorial so, basically I'm having problems in creating data URI containing information about time and animation.
The procedure I'm using in creating those data URIs, consists of writing times and coordinates in a file saved with no extension (to have a generic binary data application/octet-stream) , and then converting this file in a data URI with an [online converter](https://www.adminbooster.com/tool/data_uri) .

[Here](https://github.com/Ludovicolin/LL/blob/main/TIME+COORDINATES) you can see how I write the file to be converted in data URI that contains coordinates and time, and [here](https://github.com/Ludovicolin/LL/blob/main/1B_TRANSLATION_PLANE.JSON) you can see how the translation written in previous link doesn't work in the initial glTF of the plane. I suppose the error is the way i write the time and coordinates. How should I write those coordinates and time to be converted in data URI to be properly read and executed by the glTF?

I've even tried to separate time and coordinates by creating two different buffers, one referring to time and one referring to animation, to avoid the problem of making mistakes in setting the byteOffset property in the accessors referring to animation and time.
[Here](https://github.com/Ludovicolin/LL/blob/main/2B_DYNAMIC_TRANSLATION_PLANE.JSON) you can see the code of a translation applied to the same plane using the two new buffers referring to time and translation.  
The structure of the starting file, later converted in data URI, containing information regarding time follows:

(0.0),  
(0.25),  
(0.5),  
(0.75),  
(1.0)

The structure of the starting file, later converted in data URI, containing the translation coordinates follows:

{ 0.0, 0.0, 0.0 },  
{ 2.0, 0.0, 0.0 },  
{ 6.0, 0.0, 0.0 },  
{ 6.0, 2.0, 0.0 },  
{ 8.0, 4.0, 0.0 }

Thanks in advance for your help :)

**Tags:** 3d, animation, buffers, gltf, blender

> **Comments:**
> **username_1**: "*directly acting on its JSON*" What does that mean? Blender doesn't have any JSON in it. GLTF is something that Blender exports. Do you mean that you want to export a series of meshes each containing the post-animation vertex data for a particular frame? That is, you want to convert Blender animation into vertex animation? This seems to be a question more about Blender3D than GLTF.  
> **username_2**: As username_1 username_1 already mentioned, this question seems to be more about Blender. There is a StackExchange Community only for Blender ([link](https://blender.stackexchange.com/)). You might get a more detailed and faster response there. If you want to ask your question on this site, please read their help pages first and delete your question here since we want to avoid cross-site duplicates.  

---

## 0 answers

