    

 ## 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.xhtml) namespace [ANSYS](namespace_a_n_s_y_s.xhtml) { namespace Nexus { 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_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml) class [AnimationSampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml) : public Object

<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_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932) enum [AnimationSamplerType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932)

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

<a id="l00040" name="l00040"></a> 40 [AST\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932a5ce54cba61897101d0dc84e38e55d4bc) 

<a id="l00041" name="l00041"></a>[ 41](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932a5ce54cba61897101d0dc84e38e55d4bc) };

<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_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml)() {}

<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_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a2afd0c2eb27fa32e2ae6773a88139a26) static GLTFWRITERSPEC [AnimationSampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml) *[Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a2afd0c2eb27fa32e2ae6773a88139a26)([GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml) *gltf, 

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

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

<a id="l00053" name="l00053"></a> 53 [AnimationSamplerType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932) type = [AST\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932a5ce54cba61897101d0dc84e38e55d4bc) 

<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_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml) class [Animation](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml)

<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_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml)() {}

<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_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#a7b04ab1754e0cba0a61952a88534ffa0) static GLTFWRITERSPEC [Animation](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml) *[Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#a7b04ab1754e0cba0a61952a88534ffa0)([GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml) *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_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#a1149b49fdb5a350d1f4c9fa802dfc91c) GLTFWRITERSPEC virtual bool [AppendChannel](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#a1149b49fdb5a350d1f4c9fa802dfc91c)([AnimationSampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml) *sampler, 

<a id="l00085" name="l00085"></a> 85 [Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml) *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_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#aa91ee5e36a321e61a27b9741d04fb565) GLTFWRITERSPEC virtual bool [AppendChannel](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#aa91ee5e36a321e61a27b9741d04fb565)([AnimationSampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml) *sampler, 

<a id="l00093" name="l00093"></a> 93 [Material](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml) *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::Nexus::GLTFWriter::AnimationSampler](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml)

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

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



[ANSYS::Nexus::GLTFWriter::AnimationSampler::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a2afd0c2eb27fa32e2ae6773a88139a26)

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



[ANSYS::Nexus::GLTFWriter::AnimationSampler::AnimationSamplerType](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932)

AnimationSamplerType

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



[ANSYS::Nexus::GLTFWriter::AnimationSampler::AST\_LINEAR](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation_sampler.xhtml#a79f9f2fc6db56d1fccc493a6efe4f932a5ce54cba61897101d0dc84e38e55d4bc)

@ AST_LINEAR

Linear interploation.

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



[ANSYS::Nexus::GLTFWriter::Animation](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml)

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

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



[ANSYS::Nexus::GLTFWriter::Animation::AppendChannel](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#a1149b49fdb5a350d1f4c9fa802dfc91c)

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



[ANSYS::Nexus::GLTFWriter::Animation::Create](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#a7b04ab1754e0cba0a61952a88534ffa0)

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



[ANSYS::Nexus::GLTFWriter::Animation::AppendChannel](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_animation.xhtml#aa91ee5e36a321e61a27b9741d04fb565)

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



[ANSYS::Nexus::GLTFWriter::Attribute](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_attribute.xhtml)

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

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



[ANSYS::Nexus::GLTFWriter::GLTF](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_g_l_t_f.xhtml)

This is the main class of the GLTFWriter.

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



[ANSYS::Nexus::GLTFWriter::Material](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_material.xhtml)

Materials describe how primitives are rendered.

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



[ANSYS::Nexus::GLTFWriter::Node](class_a_n_s_y_s_1_1_nexus_1_1_g_l_t_f_writer_1_1_node.xhtml)

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.xhtml#l00030)



[ANSYS](namespace_a_n_s_y_s.xhtml)

GLTFWriter API Documentation.

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