StopAnimation

Category: Animations
Since engine version: 1.0 OC

Description

Stops the animation corresponding to the given number (such as returned by PlayAnimation) and removes it from the corresponding slot in the animation stack. If there is a combination node associated to that number then both of the anmiations being combined are removed as well; if either or both of those are combination nodes again then they are also removed and so on. If the node to be removed is combined with another node then the combining node is also removed because there is not anything to combine anymore. The function returns true if the animation was removed or false otherwise (for example if there is no animation for the given number or if belongs to slot 0).

Syntax

bool StopAnimation(int animation_number, int attach_number);

Parameters

animation_number:
Number of the animation to stop.
attach_number:
[opt] If given, refers to the number of the attached mesh to use instead of the object's main mesh.

Remark

See the animation documentation for further explanations of the animation system.

Example

StopAnimation(GetRootAnimation(5));
Removes all animations in slot 5 so that it does not contain any animations anymore afterwards.
See also: PlayAnimation
Clonk-Karl, 2010-01