Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

README.md

Outline

Split long animation into a number of smaller logical animations (subanimations)

Some 3D models contain one long animation (like Take 001 which seems to be created by default in 3ds Max), and the 3D artist relies that you split the long animation into smaller animations (more logical to use) on the game engine side.

This example shows how to do it.

We call the smaller animations "subanimations" in this demo, since they are a subrange of some larger animation.

This example defines TSubAnimations behavior class, descendant of TCastleBehavior. This behavior can be added to parent TCastleScene and play subanimations there:

  • Define subanimations using TSubAnimations.Add.

  • Read information about subanimations by TSubAnimations.List.

  • Play the subanimation using TSubAnimations.Play.

Internally: the playback uses TCastleSceneCore.ForceAnimationPose to update each frame. It is done by TSubAnimations.Update.

Note: Castle Game Engine API of TCastleScene allows you to access the long animation, using TCastleSceneCore.PlayAnimation, TCastleSceneCore.ForceAnimationPose, TCastleSceneCore.AnimationsList. You should not use it directly if you want to use subanimations.

Screenshot

Using Castle Game Engine.

Building

Compile by:

  • CGE editor. Just use menu items "Compile" or "Compile And Run".

  • Or use CGE command-line build tool. Run castle-engine compile in this directory.

  • Or use Lazarus. Open in Lazarus split_long_animation_standalone.lpi file and compile / run from Lazarus. Make sure to first register CGE Lazarus packages.

  • Or use Delphi. Open in Delphi split_long_animation_standalone.dproj file and compile / run from Delphi. See CGE and Delphi documentation for details.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.