PartGroup¶
from panda3d.core import PartGroup
-
class
PartGroup
¶ 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.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¶
-
enumerator
-
__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.
-
clearForcedChannel
() → bool¶ Undoes the effect of a previous call to
applyFreeze()
orapplyControl()
. 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 alsogetChildNamed()
.
-
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 alsofindChild()
.
-
static
getClassType
() → TypeHandle¶
-
getForcedChannel
() → AnimChannelBase¶ Returns the
AnimChannelBase
that has been forced to this joint by a previous call toapplyFreeze()
orapplyControl()
, or NULL if no such channel has been applied.
-
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.
-
enum