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
-
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
-
enumerator HMF_ok_part_extra = 1
- __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.
- clear_forced_channel() bool
Undoes the effect of a previous call to
apply_freeze()
orapply_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 alsoget_child_named()
.
- 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 alsofind_child()
.
- static get_class_type() TypeHandle
- get_forced_channel() AnimChannelBase
Returns the
AnimChannelBase
that has been forced to this joint by a previous call toapply_freeze()
orapply_control()
, or NULL if no such channel has been applied.
- 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.
-
enum HierarchyMatchFlags