WeakNodePath¶
from panda3d.core import WeakNodePath
-
class
WeakNodePath
¶ This class is a wrapper around a
NodePath
that, unlike the actualNodePath
class, doesn’t hold a reference count to the node. Thus the node may be detached from the scene graph and destructed at any time.You can call is_valid() or
wasDeleted()
at any time to determine whether the node is still around; if it is,getNodePath()
will return the associatedNodePath
.Inheritance diagram
-
__eq__
(other: WeakNodePath) → bool
-
__init__
(copy: WeakNodePath)
-
__lt__
(other: WeakNodePath) → bool
-
__ne__
(other: WeakNodePath) → bool
-
assign
(node_path: NodePath) → WeakNodePath¶
-
assign
(copy: WeakNodePath) → WeakNodePath
-
compareTo
(other: NodePath) → int¶ Returns a number less than zero if this
NodePath
sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.Two
NodePaths
are considered equivalent if they consist of exactly the same list of nodes in the same order. Otherwise, they are different; differentNodePaths
will be ranked in a consistent but undefined ordering; the ordering is useful only for placing theNodePaths
in a sorted container like an STL set.
-
compareTo
(other: WeakNodePath) → int Returns a number less than zero if this
WeakNodePath
sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.Two
WeakNodePaths
are considered equivalent if they consist of exactly the same list of nodes in the same order. Otherwise, they are different; differentWeakNodePaths
will be ranked in a consistent but undefined ordering; the ordering is useful only for placing theWeakNodePaths
in a sorted container like an STL set.
-
getKey
() → int¶ Returns the same values as
NodePath.getKey()
.
-
getNodePath
() → NodePath¶ Returns the
NodePath
held within this object, or an emptyNodePath
with the error flag set if the object was deleted.
-
node
() → PandaNode¶ Returns the
PandaNode
held within this object, or nullptr if the object was deleted.
-
wasDeleted
() → bool¶ Returns true if the
NodePath
we were referencing has been quietly deleted outside of theWeakNodePath
.
-