Skip to main content

Post-processing tools 2023 R2

ANSYS::Nexus::GLTFWriter::Animation Class Reference

Last update: 17.04.2023

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

#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 AnimationCreate (GLTF *gltf, const char *name=0)
 

Detailed Description

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

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.

Definition at line 68 of file GLTFAnimation.h.

Member Function Documentation

◆ AppendChannel() [1/2]

virtual bool ANSYS::Nexus::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::Nexus::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.

◆ Create()

static Animation* ANSYS::Nexus::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).
Examples
Test006.cpp, and Test008.cpp.

The documentation for this class was generated from the following file:
  • D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFAnimation.h