    

 ## On this page

  

 

 # GLTFAnimation

 Last update: 16.07.2025 

<a id="l00001" name="l00001"></a> 1/\*

<a id="l00002" name="l00002"></a> 2 \* Copyright 2018-2021 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.

<a id="l00003" name="l00003"></a> 3 \* 

<a id="l00004" name="l00004"></a> 4 \* Restricted Rights Legend

<a id="l00005" name="l00005"></a> 5 \*

<a id="l00006" name="l00006"></a> 6 \* Use, duplication, or disclosure of this

<a id="l00007" name="l00007"></a> 7 \* software and its documentation by the

<a id="l00008" name="l00008"></a> 8 \* Government is subject to restrictions as

<a id="l00009" name="l00009"></a> 9 \* set forth in subdivision \[(b)(3)(ii)\] of

<a id="l00010" name="l00010"></a> 10 \* the Rights in Technical Data and Computer

<a id="l00011" name="l00011"></a> 11 \* Software clause at 52.227-7013.

<a id="l00012" name="l00012"></a> 12 \*/

<a id="l00013" name="l00013"></a> 13\#ifndef \_\_INCLUDED\_GLTF\_GLTFANIMATION\_\_

<a id="l00014" name="l00014"></a> 14\#define \_\_INCLUDED\_GLTF\_GLTFANIMATION\_\_

<a id="l00015" name="l00015"></a> 15 

<a id="l00016" name="l00016"></a> 16\#include "GLTFCommon.h"

<a id="l00017" name="l00017"></a> 17\#include "GLTFObject.h"

<a id="l00018" name="l00018"></a> 18 

<a id="l00019" name="l00019"></a>[ 19](namespace_a_n_s_y_s.html)namespace [ANSYS](namespace_a_n_s_y_s.html) { namespace AVZ { namespace GLTFWriter {

<a id="l00020" name="l00020"></a> 20 class GLTF;

<a id="l00021" name="l00021"></a> 21 class Attribute;

<a id="l00022" name="l00022"></a> 22 class Material;

<a id="l00023" name="l00023"></a> 23 class Node;

<a id="l00024" name="l00024"></a> 24 

<a id="l00034" name="l00034"></a>[ 34](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html) class [AnimationSampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html) : public [Object](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_object.html)

<a id="l00035" name="l00035"></a> 35 {

<a id="l00036" name="l00036"></a> 36 public:

<a id="l00038" name="l00038"></a>[ 38](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37) enum [AnimationSamplerType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37)

<a id="l00039" name="l00039"></a> 39 {

<a id="l00040" name="l00040"></a> 40 [AST\_LINEAR](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37a375135f27372c8fd48dbcc371a05e1d9) 

<a id="l00041" name="l00041"></a>[ 41](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37a375135f27372c8fd48dbcc371a05e1d9) };



<a id="l00042" name="l00042"></a> 42 

<a id="l00043" name="l00043"></a> 43 protected:

<a id="l00044" name="l00044"></a> 44 virtual [~AnimationSampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html)() {}

<a id="l00045" name="l00045"></a> 45 

<a id="l00046" name="l00046"></a> 46 public:

<a id="l00050" name="l00050"></a>[ 50](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#ab00b9f4628b9851dd44fb29f16960bdf) static GLTFWRITERSPEC [AnimationSampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html) *[Create](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#ab00b9f4628b9851dd44fb29f16960bdf)([GLTF](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_g_l_t_f.html) *gltf, 

<a id="l00051" name="l00051"></a> 51 [Attribute](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_attribute.html) *input, 

<a id="l00052" name="l00052"></a> 52 [Attribute](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_attribute.html) *output, 

<a id="l00053" name="l00053"></a> 53 [AnimationSamplerType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37) type = [AST\_LINEAR](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37a375135f27372c8fd48dbcc371a05e1d9) 

<a id="l00054" name="l00054"></a> 54 );

<a id="l00055" name="l00055"></a> 55 };



<a id="l00056" name="l00056"></a> 56 

<a id="l00068" name="l00068"></a>[ 68](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html) class [Animation](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html)

<a id="l00069" name="l00069"></a> 69 {

<a id="l00070" name="l00070"></a> 70 protected:

<a id="l00071" name="l00071"></a> 71 virtual [~Animation](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html)() {}

<a id="l00072" name="l00072"></a> 72 

<a id="l00073" name="l00073"></a> 73 public:

<a id="l00076" name="l00076"></a>[ 76](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a41da064e3a9c9d690d951287bb4760f6) static GLTFWRITERSPEC [Animation](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html) *[Create](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a41da064e3a9c9d690d951287bb4760f6)([GLTF](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_g_l_t_f.html) *gltf, 

<a id="l00077" name="l00077"></a> 77 const char *name = 0 

<a id="l00078" name="l00078"></a> 78 );

<a id="l00079" name="l00079"></a> 79 

<a id="l00084" name="l00084"></a>[ 84](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a3963dbc5049f56224031b9d748f5ecfa) GLTFWRITERSPEC virtual bool [AppendChannel](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a3963dbc5049f56224031b9d748f5ecfa)([AnimationSampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html) *sampler, 

<a id="l00085" name="l00085"></a> 85 [Node](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_node.html) *target, 

<a id="l00086" name="l00086"></a> 86 const char *path 

<a id="l00087" name="l00087"></a> 87 ) = 0;

<a id="l00092" name="l00092"></a>[ 92](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a83b5ab732cef515bb687a46b062cb98e) GLTFWRITERSPEC virtual bool [AppendChannel](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a83b5ab732cef515bb687a46b062cb98e)([AnimationSampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html) *sampler, 

<a id="l00093" name="l00093"></a> 93 [Material](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_material.html) *target, 

<a id="l00094" name="l00094"></a> 94 const char *path 

<a id="l00095" name="l00095"></a> 95 ) = 0;

<a id="l00096" name="l00096"></a> 96 };



<a id="l00097" name="l00097"></a> 97 

<a id="l00098" name="l00098"></a> 98} } }



<a id="l00099" name="l00099"></a> 99 

<a id="l00100" name="l00100"></a> 100\#endif

<a id="l00101" name="l00101"></a> 101 

[ANSYS::AVZ::GLTFWriter::Animation](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html)

Animations define mechanisms for changing over time, node properties and material values.

**Definition** [GLTFAnimation.h:69](#l00068)



[ANSYS::AVZ::GLTFWriter::Animation::AppendChannel](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a3963dbc5049f56224031b9d748f5ecfa)

virtual bool AppendChannel(AnimationSampler *sampler, Node *target, const char *path)=0



[ANSYS::AVZ::GLTFWriter::Animation::Create](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a41da064e3a9c9d690d951287bb4760f6)

static Animation * Create(GLTF *gltf, const char *name=0)



[ANSYS::AVZ::GLTFWriter::Animation::AppendChannel](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation.html#a83b5ab732cef515bb687a46b062cb98e)

virtual bool AppendChannel(AnimationSampler *sampler, Material *target, const char *path)=0



[ANSYS::AVZ::GLTFWriter::AnimationSampler](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html)

Animation samplers define mechanisms for defining how animation channels change over time.

**Definition** [GLTFAnimation.h:35](#l00034)



[ANSYS::AVZ::GLTFWriter::AnimationSampler::AnimationSamplerType](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37)

AnimationSamplerType

**Definition** [GLTFAnimation.h:39](#l00038)



[ANSYS::AVZ::GLTFWriter::AnimationSampler::AST\_LINEAR](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#a57c4f92a5ea8417ee8908c9929403f37a375135f27372c8fd48dbcc371a05e1d9)

@ AST_LINEAR

Linear interploation.

**Definition** [GLTFAnimation.h:40](#l00041)



[ANSYS::AVZ::GLTFWriter::AnimationSampler::Create](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_animation_sampler.html#ab00b9f4628b9851dd44fb29f16960bdf)

static AnimationSampler * Create(GLTF *gltf, Attribute *input, Attribute *output, AnimationSamplerType type=AST_LINEAR)



[ANSYS::AVZ::GLTFWriter::Attribute](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_attribute.html)

Attributes define the per element index values for elements defined by Index.

**Definition** [GLTFAttribute.h:32](_g_l_t_f_attribute_8h_source.html#l00031)



[ANSYS::AVZ::GLTFWriter::GLTF](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_g_l_t_f.html)

This is the main class of the GLTFWriter.

**Definition** [GLTFGLTF.h:32](_g_l_t_f_g_l_t_f_8h_source.html#l00031)



[ANSYS::AVZ::GLTFWriter::Material](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_material.html)

Materials describe how primitives are rendered.

**Definition** [GLTFMaterial.h:30](_g_l_t_f_material_8h_source.html#l00029)



[ANSYS::AVZ::GLTFWriter::Node](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_node.html)

Nodes are the GLTFWriter class that contain the data that is defined in the GLTF file.

**Definition** [GLTFNode.h:31](_g_l_t_f_node_8h_source.html#l00030)



[ANSYS::AVZ::GLTFWriter::Object](class_a_n_s_y_s_1_1_a_v_z_1_1_g_l_t_f_writer_1_1_object.html)

Object is base class for GLTF objects.

**Definition** [GLTFObject.h:23](_g_l_t_f_object_8h_source.html#l00022)



[ANSYS](namespace_a_n_s_y_s.html)

GLTFWriter API Documentation.

**Definition** [GLTFAnimation.h:19](#l00019)