# panda3d.core.AnimControl¶

class AnimControl

Controls the timing of a character animation. An AnimControl object is created for each character/bundle binding and manages the state of the animation: whether started, stopped, or looping, and the current frame number and play rate.

Inheritance diagram

isPending() → bool

Returns true if the AnimControl is being bound asynchronously, and has not yet finished. If this is true, the AnimControl’s interface is still available and will be perfectly useful (though getAnim() might return NULL), but nothing visible will happen immediately.

waitPending() → None

hasAnim() → bool

Returns true if the AnimControl was successfully loaded, or false if there was a problem. This may return false while isPending() is true.

setPendingDoneEvent(done_event: str) → None

Specifies an event name that will be thrown when the AnimControl is finished binding asynchronously. If the AnimControl has already finished binding, the event will be thrown immediately.

getPendingDoneEvent() → str

Returns the event name that will be thrown when the AnimControl is finished binding asynchronously.

getPart() → PartBundle

Returns the PartBundle bound in with this AnimControl.

Return type

PartBundle

getAnim() → AnimBundle

Returns the AnimBundle bound in with this AnimControl.

Return type

AnimBundle

getChannelIndex() → int

Returns the particular channel index associated with this AnimControl. This channel index is the slot on which each AnimGroup is bound to its associated PartGroup, for each joint in the animation.

It will be true that getPart()->find_child(“n”)->get_bound(getChannelIndex()) == getAnim()->find_child(“n”), for each joint “n”.

getBoundJoints() → BitArray

Returns the subset of joints controlled by this AnimControl. Most of the time, this will be BitArray.allOn(), for a normal full-body animation. For a subset animation, however, this will be just a subset of those bits, corresponding to the set of joints and sliders actually bound (as enumerated by bind_hierarchy() in depth-first LIFO order).

Return type

BitArray

setAnimModel(model: PandaNode) → None

Associates the indicated PandaNode with the AnimControl. By convention, this node represents the root node of the model file that corresponds to this AnimControl’s animation file, though nothing in this code makes this assumption or indeed does anything with this node.

The purpose of this is simply to allow the AnimControl to keep a reference count on the ModelRoot node that generated it, so that the model will not disappear from the model pool until it is no longer referenced.

getAnimModel() → PandaNode

Retrieves the pointer set via setAnimModel(). See setAnimModel().

Return type

PandaNode

output(out: ostream) → None
static getClassType() → TypeHandle
Return type

TypeHandle