# PartGroup¶

from panda3d.core import PartGroup

class PartGroup

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

Inheritance diagram

enum HierarchyMatchFlags

This enum defines bits which may be passed into check_hierarchy() and PartBundle.bindAnim() 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.

applyControl(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.controlJoint(), but you may also call it directly.

applyFreeze(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.freezeJoint(), but you may also call it directly.

applyFreezeMatrix(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.freezeJoint(), but you may also call it directly.

applyFreezeScalar(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.freezeJoint(), but you may also call it directly.

property children → Sequence[PartGroup]

Returns the nth child of the group.

clearForcedChannel()bool

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

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

copySubgraph()PartGroup

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

findChild(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 getChildNamed().

getChild(n: int)PartGroup

Returns the nth child of the group.

getChildNamed(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 findChild().

getChildren()list
static getClassType()TypeHandle
getForcedChannel()AnimChannelBase

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

getNumChildren()int

Returns the number of child nodes of the group.

isCharacterJoint()bool

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

makeCopy()PartGroup

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

sortDescendants()None

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)None

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

writeWithValue(out: ostream, indent_level: int)None

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