AnimGroup

class AnimGroup

Bases: TypedWritableReferenceCount, Namable

This is the base class for AnimChannel and AnimBundle. It implements a hierarchy of AnimChannels. The root of the hierarchy must be an AnimBundle.

Inheritance diagram

Inheritance diagram of AnimGroup

explicit AnimGroup(AnimGroup *parent, std::string const &name)
AnimGroup(AnimGroup const&) = default

This is the normal AnimGroup constructor.

The default constructor is protected: don’t try to create an AnimGroup without a parent. To create an AnimChannel hierarchy, you must first create an AnimBundle, and use that to create any subsequent children.

Creates a new AnimGroup, just like this one, without copying any children. The new copy is added to the indicated parent. Intended to be called by make_copy() only.

Creates the AnimGroup, and adds it to the indicated parent. The only way to delete it subsequently is to delete the entire hierarchy.

AnimGroup *find_child(std::string const &name) const

Returns the first descendant found with the indicated name, or NULL if no such descendant exists. This method searches the entire graph beginning at this AnimGroup; see also get_child_named().

AnimGroup *get_child(int n) const

Returns the nth child of the group.

AnimGroup *get_child_named(std::string const &name) const

Returns the first child found with the indicated name, or NULL if no such child exists. This method searches only the children of this particular AnimGroup; it does not recursively search the entire graph. See also find_child().

static TypeHandle get_class_type(void)
int get_num_children(void) const

Returns the number of child nodes of the group.

virtual void output(std::ostream &out) const

Writes a one-line description of the group.

void sort_descendants(void)

Sorts the children nodes at each level of the hierarchy into alphabetical order. This should be done after creating the hierarchy, to guarantee that the correct names will match up together when the AnimBundle is later bound to a PlayerRoot.

virtual void write(std::ostream &out, int indent_level) const

Writes a brief description of the group and all of its descendants.