Skip to main content

Post-processing tools 2025 R1

ANSYS::AVZ::GLTFWriter::Animation Class Reference

Last update: 16.07.2025

#include <GLTFWriter.h>

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Currently, only the node matrix, node visibility, and all material values can be changed. The initial node matrix and node visibility are passed to the Node::CreateMesh method and must be specified if their values are to be changed in the Animation. Similarly, for a material value to be animated, it must first be added to the material with the Material::AppendValue method.

It is possible for a GLTF/AVZ file to have more than one animation. Currently, only a single animation is shown in the viewer. If multiple animations are created, they are all played as a single animation. So it might be wise to only create a single animation at present until this limitation is removed.

Examples
Test006.cpp, and Test008.cpp.

Definition at line 68 of file GLTFAnimation.h.

Constructor & Destructor Documentation

◆ ~Animation()

virtual ANSYS::AVZ::GLTFWriter::Animation::~Animation ( )
inlineprotectedvirtual

Definition at line 71 of file GLTFAnimation.h.

Member Function Documentation

◆ AppendChannel() [1/2]

virtual bool ANSYS::AVZ::GLTFWriter::Animation::AppendChannel ( AnimationSampler * sampler,
Material * target,
const char * path )
pure virtual

Adds a channel to an animation. The channel changes the target/path using the sampler. Only some properties can be animated:

  • node - matrix
  • node - visible
  • material - Any value
    Returns
    Status of AppendChannel.
Parameters
[in]samplerAnimationSampler object.
[in]targetNode of which to animate a property, or Material of which to animate a value.
[in]pathName of property or name of value to animate.

◆ AppendChannel() [2/2]

virtual bool ANSYS::AVZ::GLTFWriter::Animation::AppendChannel ( AnimationSampler * sampler,
Node * target,
const char * path )
pure virtual

Adds a channel to an animation. The channel changes the target/path using the sampler. Only some properties can be animated:

  • node - matrix
  • node - visible
  • material - Any value
    Returns
    Status of AppendChannel.
Parameters
[in]samplerAnimationSampler object.
[in]targetNode of which to animate a property, or Material of which to animate a value.
[in]pathName of property or name of value to animate.
Examples
Test006.cpp, and Test008.cpp.

◆ Create()

static Animation * ANSYS::AVZ::GLTFWriter::Animation::Create ( GLTF * gltf,
const char * name = 0 )
static

Creates an animation with the given name.

Returns
Animation object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]nameOptional, name of animation (not currently used).

The documentation for this class was generated from the following file:
  • D:/ANSYSDev/Product-src/webgl_viewer/gltfwriterlib/include/GLTFAnimation.h

Connect with Ansys