AnimControl
from panda3d.core import AnimControl
- class AnimControl
Bases:
Bases:
TypedReferenceCount
,AnimInterface
,Namable
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
- get_anim() AnimBundle
Returns the
AnimBundle
bound in with thisAnimControl
.
- get_anim_model() PandaNode
Retrieves the pointer set via
set_anim_model()
. Seeset_anim_model()
.
- get_bound_joints() BitArray
Returns the subset of joints controlled by this
AnimControl
. Most of the time, this will beBitArray.all_on()
, 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).
- get_channel_index() int
Returns the particular channel index associated with this
AnimControl
. This channel index is the slot on which eachAnimGroup
is bound to its associatedPartGroup
, for each joint in the animation.It will be true that get_part()->find_child(“n”)->get_bound(get_channel_index()) == get_anim()->find_child(“n”), for each joint “n”.
- static get_class_type() TypeHandle
- get_part() PartBundle
Returns the
PartBundle
bound in with thisAnimControl
.
- get_pending_done_event() str
Returns the event name that will be thrown when the
AnimControl
is finished binding asynchronously.
- has_anim() bool
Returns true if the
AnimControl
was successfully loaded, or false if there was a problem. This may return false whileis_pending()
is true.
- is_pending() 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 (thoughget_anim()
might return NULL), but nothing visible will happen immediately.
- set_anim_model(model: PandaNode)
Associates the indicated
PandaNode
with theAnimControl
. 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 theModelRoot
node that generated it, so that the model will not disappear from the model pool until it is no longer referenced.
- set_pending_done_event(done_event: str)
Specifies an event name that will be thrown when the
AnimControl
is finished binding asynchronously. If theAnimControl
has already finished binding, the event will be thrown immediately.
- wait_pending()
Blocks the current thread until the
AnimControl
has finished loading and is fully bound.