PartGroup

from panda3d.core import PartGroup
class PartGroup

Bases:

Bases: TypedWritableReferenceCount, Namable

This is the base class for PartRoot and MovingPart. It defines a hierarchy of MovingParts.

Inheritance diagram

Inheritance diagram of PartGroup

enum HierarchyMatchFlags

This enum defines bits which may be passed into check_hierarchy() and PartBundle.bind_anim() to allow an inexact match of channel hierarchies. This specifies conditions that we don’t care about enforcing.

enumerator HMF_ok_part_extra = 1
enumerator HMF_ok_anim_extra = 2
enumerator HMF_ok_wrong_root_name = 4
__init__(parent: PartGroup, name: str)

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

apply_control(node: PandaNode) bool

Specifies a node to influence this particular joint so that it will always hold the node’s transform. Returns true if this is a joint that can be so controlled, false otherwise.

This is normally only called internally by PartBundle.control_joint(), but you may also call it directly.

apply_freeze(transform: TransformState) bool

Freezes this particular joint so that it will always hold the specified transform. Returns true if this is a joint that can be so frozen, false otherwise.

This is normally only called internally by PartBundle.freeze_joint(), but you may also call it directly.

apply_freeze_matrix(pos: LVecBase3, hpr: LVecBase3, scale: LVecBase3) bool

Freezes this particular joint so that it will always hold the specified transform. Returns true if this is a joint that can be so frozen, false otherwise.

This is normally only called internally by PartBundle.freeze_joint(), but you may also call it directly.

apply_freeze_scalar(value: float) bool

Freezes this particular joint so that it will always hold the specified transform. Returns true if this is a joint that can be so frozen, false otherwise.

This is normally only called internally by PartBundle.freeze_joint(), but you may also call it directly.

property children Sequence[PartGroup]

Returns the nth child of the group.

clear_forced_channel() bool

Undoes the effect of a previous call to apply_freeze() or apply_control(). Returns true if the joint was modified, false otherwise.

This is normally only called internally by PartBundle.release_joint(), but you may also call it directly.

copy_subgraph() PartGroup

Allocates and returns a new copy of this node and of all of its children.

find_child(name: str) PartGroup

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 PartGroup; see also get_child_named().

get_child(n: int) PartGroup

Returns the nth child of the group.

get_child_named(name: str) PartGroup

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 PartGroup; it does not recursively search the entire graph. See also find_child().

get_children() list
static get_class_type() TypeHandle
get_forced_channel() AnimChannelBase

Returns the AnimChannelBase that has been forced to this joint by a previous call to apply_freeze() or apply_control(), or NULL if no such channel has been applied.

get_num_children() int

Returns the number of child nodes of the group.

is_character_joint() bool

Returns true if this part is a CharacterJoint, false otherwise. This is a tiny optimization over is_of_type(CharacterType::get_class_type()).

make_copy() PartGroup

Allocates and returns a new copy of the node. Children are not copied, but see copy_subgraph().

sort_descendants()

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.

write(out: ostream, indent_level: int)

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

write_with_value(out: ostream, indent_level: int)

Writes a brief description of the group, showing its current value, and that of all of its descendants.