panda3d.core.NodePath

from panda3d.core import NodePath
class NodePath

NodePath is the fundamental system for disambiguating instances, and also provides a higher-level interface for manipulating the scene graph.

A NodePath is a list of connected nodes from the root of the graph to any sub-node. Each NodePath therefore uniquely describes one instance of a node.

NodePaths themselves are lightweight objects that may easily be copied and passed by value. Their data is stored as a series of NodePathComponents that are stored on the nodes. Holding a NodePath will keep a reference count to all the nodes in the path. However, if any node in the path is removed or reparented (perhaps through a different NodePath), the NodePath will automatically be updated to reflect the changes.

Inheritance diagram

Inheritance diagram of NodePath

enum ErrorType

This enumeration is returned by getErrorType() for an empty NodePath to report the reason it’s empty.

enumerator ET_ok = 0

i.e. not empty, or never assigned to anything.

enumerator ET_not_found = 1

returned from a failed find() or similar function.

enumerator ET_removed = 2

remove_node() was previously called on this NodePath.

enumerator ET_fail = 3

general failure return from some function.

__init__() → None

This constructs an empty NodePath with no nodes.

__init__(from: NodePath) → None
__init__(copy: NodePath) → None
__init__(parent: NodePath, child_node: PandaNode, current_thread: Thread) → None

Constructs a NodePath with the indicated parent NodePath and child node; the child node must be a stashed or unstashed child of the parent.

__init__(node: PandaNode, current_thread: Thread) → None

This constructs a NodePath for the indicated node. If the node does not have any parents, this creates a singleton NodePath; otherwise, it automatically finds the path from the node to the root. If the node has multiple paths to the root, one path is chosen arbitrarily and a warning message is printed (but see also NodePath.anyPath(), below).

__init__(top_node_name: str, current_thread: Thread) → None

This constructs a new NodePath with a single node. An ordinary, unattached PandaNode is created with the indicated name.

addHash(hash: size_t) → size_t

Adds the NodePath into the running hash. This is intended to be used by lower-level code that computes a hash for each NodePath. It modifies the hash value passed in by a unique adjustment for each NodePath, and returns the modified hash.

This is similar to the unique integer returned by getKey(), but it is not guaranteed to remain unique beyond the lifetime of this particular NodePath. Once this NodePath destructs, a different NodePath may be created which shares the same hash value.

Return type

size_t

adjustAllPriorities(adjustment: int) → None

Adds the indicated adjustment amount (which may be negative) to the priority for all transitions on the referenced node, and for all nodes in the subgraph below. This can be used to force these nodes not to be overridden by a high-level state change above. If the priority would drop below zero, it is set to zero.

property ancestors

Returns the nth ancestor of the path, where 0 is the NodePath itself and getNumNodes() - 1 is getTop(). This requires iterating through the path.

Also see getNode(), which returns the same thing as a PandaNode pointer, not a NodePath.

Return type

Sequence[NodePath]

static anyPath(node: PandaNode, current_thread: Thread) → NodePath

Returns a new NodePath that represents any arbitrary path from the root to the indicated node. This is the same thing that would be returned by NodePath(node), except that no warning is issued if the path is ambiguous.

Return type

NodePath

applyTextureColors() → None

Removes textures from Geoms at this node and below by applying the texture colors to the vertices. This is primarily useful to simplify a low-LOD model. The texture colors are replaced by flat colors that approximate the original textures.

Only the bottommost texture on each Geom is used (if there is more than one), and it is applied as if it were M_modulate, and WM_repeat, regardless of its actual settings. If the texture has a simple_ram_image, this may be used if the main image isn’t resident.

After this call, there will be no texturing specified at this level and below. Of course, there might still be texturing inherited from above.

assign(from: NodePath) → NodePath
Return type

NodePath

assign(copy: NodePath) → NodePath
Return type

NodePath

attachNewNode(node: PandaNode, sort: int, current_thread: Thread) → NodePath

Attaches a new node, with or without existing parents, to the scene graph below the referenced node of this NodePath. This is the preferred way to add nodes to the graph.

If the node was already a child of the parent, this returns a NodePath to the existing child.

This does not automatically extend the current NodePath to reflect the attachment; however, a NodePath that does reflect this extension is returned.

Return type

NodePath

attachNewNode(name: str, sort: int, current_thread: Thread) → NodePath

Creates an ordinary PandaNode and attaches it below the current NodePath, returning a new NodePath that references it.

Return type

NodePath

calcTightBounds(min_point: LPoint3, max_point: LPoint3, other: NodePath, current_thread: Thread) → bool

Calculates the minimum and maximum vertices of all Geoms at this NodePath’s bottom node and below. This is a tight bounding box; it will generally be tighter than the bounding volume returned by getBounds() (but it is more expensive to compute).

The bounding box is computed relative to the parent node’s coordinate system by default. You can optionally specify a different NodePath to compute the bounds relative to. Note that the box is always axis-aligned against the given NodePath’s coordinate system, so you might get a differently sized box depending on which node you pass.

The return value is true if any points are within the bounding volume, or false if none are.

property children

Returns the set of all child nodes of the referenced node.

Return type

NodePathCollection

clear() → None

Sets this NodePath to the empty NodePath. It will no longer point to any node.

clearAntialias() → None

Completely removes any antialias setting that may have been set on this node via setAntialias().

clearAttrib(type: TypeHandle) → None

Removes the render attribute of the given type from this node. This node, and the subgraph below, will now inherit the indicated render attribute from the nodes above this one.

clearAudioVolume() → None

Completely removes any audio volume from the referenced node. This is preferable to simply setting the audio volume to identity, as it also removes the overhead associated with having an audio volume at all.

clearBillboard() → None

Removes any billboard effect from the node.

clearBin() → None

Completely removes any bin adjustment that may have been set via setBin() from this particular node.

clearClipPlane() → None

Completely removes any clip planes that may have been set via setClipPlane() or setClipPlaneOff() from this particular node.

clearClipPlane(clip_plane: NodePath) → None

Removes any reference to the indicated clipping plane from the NodePath.

clearColor() → None

Completely removes any color adjustment from the node. This allows the natural color of the geometry, or whatever color transitions might be otherwise affecting the geometry, to show instead.

clearColorScale() → None

Completely removes any color scale from the referenced node. This is preferable to simply setting the color scale to identity, as it also removes the overhead associated with having a color scale at all.

clearCompass() → None

Removes any compass effect from the node.

clearDepthOffset() → None

Completely removes any depth-offset adjustment that may have been set on this node via setDepthOffset().

clearDepthTest() → None

Completely removes any depth-test adjustment that may have been set on this node via setDepthTest().

clearDepthWrite() → None

Completely removes any depth-write adjustment that may have been set on this node via setDepthWrite().

clearEffect(type: TypeHandle) → None

Removes the render effect of the given type from this node.

clearEffects() → None

Resets this node to have no render effects.

clearFog() → None

Completely removes any fog adjustment that may have been set via setFog() or setFogOff() from this particular node. This allows whatever fogs might be otherwise affecting the geometry to show instead.

clearLight() → None

Completely removes any lighting operations that may have been set via setLight() or setLightOff() from this particular node.

clearLight(light: NodePath) → None

Removes any reference to the indicated Light or PolylightNode from the NodePath.

clearLogicOp() → None

Completely removes any logical operation that may have been set on this node via setLogicOp(). The geometry at this level and below will subsequently be rendered using standard color blending.

clearMat() → None

Completely removes any transform from the referenced node.

clearMaterial() → None

Completely removes any material adjustment that may have been set via setMaterial() from this particular node.

clearModelNodes() → int

Recursively walks through the scene graph at this level and below, looking for ModelNodes, and calls model_node->set_preserve_transform(PT_drop_node) on each one. This allows a subsequent call to flattenStrong() to eliminate all of the ModelNodes.

Returns the number of ModelNodes found.

clearOccluder() → None

Completely removes any occluders that may have been set via setOccluder() from this particular node.

clearOccluder(occluder: NodePath) → None

Removes any reference to the indicated occluder from the NodePath.

clearProjectTexture(stage: TextureStage) → None

Undoes the effect of projectTexture().

clearPythonTag(keys: object) → None
clearRenderMode() → None

Completely removes any render mode adjustment that may have been set on this node via setRenderModeWireframe() or setRenderModeFilled().

clearScissor() → None

Removes the scissor region that was defined at this node level by a previous call to setScissor().

clearShader() → None
clearShaderInput(id: InternalName) → None
clearTag(key: str) → None

Removes the value defined for this key on this particular node. After a call to clearTag(), hasTag() will return false for the indicated key.

clearTexGen() → None

Removes the texture coordinate generation mode from all texture stages on this node.

clearTexGen(stage: TextureStage) → None

Disables automatic texture coordinate generation for the indicated texture stage.

clearTexProjector() → None

Removes the TexProjectorEffect for all stages from this node.

clearTexProjector(stage: TextureStage) → None

Removes the TexProjectorEffect for the indicated stage from this node.

clearTexTransform() → None

Removes all texture matrices from the current node.

clearTexTransform(stage: TextureStage) → None

Removes the texture matrix on the current node for the given stage.

clearTexture() → None

Completely removes any texture adjustment that may have been set via setTexture() or setTextureOff() from this particular node. This allows whatever textures might be otherwise affecting the geometry to show instead.

clearTexture(stage: TextureStage) → None

Removes any reference to the indicated texture stage from the NodePath.

clearTransform(other: NodePath, current_thread: Thread) → None

Sets the transform object on this node to identity, relative to the other node. This effectively places this node at the same position as the other node.

clearTransform(current_thread: Thread) → None

Sets the transform object on this node to identity.

clearTransparency() → None

Completely removes any transparency adjustment that may have been set on this node via setTransparency(). The geometry at this level and below will subsequently be rendered either transparent or not, to whatever other nodes may have had setTransparency() on them.

clearTwoSided() → None

Completely removes any two-sided adjustment that may have been set on this node via setTwoSided(). The geometry at this level and below will subsequently be rendered either two-sided or one-sided, according to whatever other nodes may have had setTwoSided() on it, or according to the initial state otherwise.

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; different NodePaths will be ranked in a consistent but undefined ordering; the ordering is useful only for placing the NodePaths in a sorted container like an STL set.

compareTo(other: WeakNodePath) → 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; different NodePaths will be ranked in a consistent but undefined ordering; the ordering is useful only for placing the NodePaths in a sorted container like an STL set.

composeColorScale(scale: LVecBase4, priority: int) → None

multiplies the color scale component of the transform, with previous color scale leaving translation and rotation untouched.

composeColorScale(sx: float, sy: float, sz: float, sa: float, priority: int) → None

Sets the color scale component of the transform

copyTo(other: NodePath, sort: int, current_thread: Thread) → NodePath

Functions like instanceTo(), except a deep copy is made of the referenced node and all of its descendents, which is then parented to the indicated node. A NodePath to the newly created copy is returned.

Return type

NodePath

countNumDescendants() → int

Returns the number of nodes at and below this level.

static decodeFromBamStream(data: bytes, reader: BamReader) → NodePath

Reads the string created by a previous call to encodeToBamStream(), and extracts and returns the NodePath on that string. Returns NULL on error.

Return type

NodePath

detachNode(current_thread: Thread) → None

Disconnects the referenced node from its parent, but does not immediately delete it. The NodePath retains a pointer to the node, and becomes a singleton NodePath.

This should be called to detach a node from the scene graph, with the option of reattaching it later to the same parent or to a different parent.

In practice, the only difference between removeNode() and detachNode() is that removeNode() also resets the NodePath to empty, which will cause the node to be deleted immediately if there are no other references. On the other hand, detachNode() leaves the NodePath referencing the node, which will keep at least one reference to the node for as long as the NodePath exists.

doBillboardAxis(camera: NodePath, offset: float) → None

Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object rotated. This is similar in principle to headsUp().

doBillboardPointEye(camera: NodePath, offset: float) → None

Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object rotated. This is similar in principle to lookAt(), although the point_eye billboard effect cannot be achieved using the ordinary lookAt() call.

doBillboardPointWorld(camera: NodePath, offset: float) → None

Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object rotated. This is similar in principle to lookAt().

encodeToBamStream() → bytes

Converts the NodePath object into a single stream of data using a BamWriter, and returns that data as a string string. Returns empty string on failure. This is similar to writeBamStream().

This method is used by __reduce__ to handle streaming of NodePaths to a pickle file.

encodeToBamStream(data: bytes, writer: BamWriter) → bool

Converts the NodePath object into a single stream of data using a BamWriter, and stores that data in the indicated string. Returns true on success, false on failure.

If the BamWriter is NULL, this behaves the same way as NodePath.writeBamStream() and PandaNode::encode_to_bam_stream(), in the sense that it only writes this node and all nodes below it.

However, if the BamWriter is not NULL, it behaves very differently. In this case, it encodes the entire graph of all nodes connected to the NodePath, including all parent nodes and siblings. This is necessary for correct streaming of related NodePaths and restoration of instances, etc., but it does mean you must detach() a node before writing it if you want to limit the nodes that get written.

This method is used by __reduce__ to handle streaming of NodePaths to a pickle file. The BamWriter case is used by the direct.stdpy.pickle module, while the saner, non-BamWriter case is used when the standard pickle module calls this function.

property error_type

If isEmpty() is true, this returns a code that represents the reason why the NodePath is empty.

Return type

ErrorType

static fail() → NodePath

Creates a NodePath with the ET_fail error type set.

Return type

NodePath

find(path: str) → NodePath

Searches for a node below the referenced node that matches the indicated string. Returns the shortest match found, if any, or an empty NodePath if no match can be found.

Return type

NodePath

findAllMatches(path: str) → NodePathCollection

Returns the complete set of all NodePaths that begin with this NodePath and can be extended by path. The shortest paths will be listed first.

Return type

NodePathCollection

findAllMaterials() → MaterialCollection

Returns a list of a materials applied to geometry at this node and below.

Return type

MaterialCollection

findAllMaterials(name: str) → MaterialCollection

Returns a list of a materials applied to geometry at this node and below that match the indicated name (which may contain wildcard characters).

Return type

MaterialCollection

findAllPathsTo(node: PandaNode) → NodePathCollection

Returns the set of all NodePaths that extend from this NodePath down to the indicated node. The shortest paths will be listed first.

Return type

NodePathCollection

findAllTexcoords() → InternalNameCollection

Returns a list of all texture coordinate sets used by any geometry at this node level and below.

Return type

InternalNameCollection

findAllTexcoords(name: str) → InternalNameCollection

Returns a list of all texture coordinate sets used by any geometry at this node level and below that match the indicated name (which may contain wildcard characters).

Return type

InternalNameCollection

findAllTextureStages() → TextureStageCollection

Returns a list of a TextureStages applied to geometry at this node and below.

Return type

TextureStageCollection

findAllTextureStages(name: str) → TextureStageCollection

Returns a list of a TextureStages applied to geometry at this node and below that match the indicated name (which may contain wildcard characters).

Return type

TextureStageCollection

findAllTextures() → TextureCollection

Returns a list of a textures applied to geometry at this node and below.

Return type

TextureCollection

findAllTextures(stage: TextureStage) → TextureCollection

Returns a list of a textures on geometry at this node and below that are assigned to the indicated texture stage.

Return type

TextureCollection

findAllTextures(name: str) → TextureCollection

Returns a list of a textures applied to geometry at this node and below that match the indicated name (which may contain wildcard characters).

Return type

TextureCollection

findAllVertexColumns() → InternalNameCollection

Returns a list of all vertex array columns stored on some geometry found at this node level and below.

Return type

InternalNameCollection

findAllVertexColumns(name: str) → InternalNameCollection

Returns a list of all vertex array columns stored on some geometry found at this node level and below that match the indicated name (which may contain wildcard characters).

Return type

InternalNameCollection

findMaterial(name: str) → Material

Returns the first material found applied to geometry at this node or below that matches the indicated name (which may contain wildcards). Returns the material if it is found, or NULL if it is not.

Return type

Material

findNetPythonTag(keys: object) → NodePath
Return type

NodePath

findNetTag(key: str) → NodePath

Returns the lowest ancestor of this node that contains a tag definition with the indicated key, if any, or an empty NodePath if no ancestor of this node contains this tag definition. See setTag().

Return type

NodePath

findPathTo(node: PandaNode) → NodePath

Searches for the indicated node below this node and returns the shortest NodePath that connects them.

Return type

NodePath

findTexture(stage: TextureStage) → Texture

Returns the first texture found applied to geometry at this node or below that is assigned to the indicated texture stage. Returns the texture if it is found, or NULL if it is not.

Return type

Texture

findTexture(name: str) → Texture

Returns the first texture found applied to geometry at this node or below that matches the indicated name (which may contain wildcards). Returns the texture if it is found, or NULL if it is not.

Return type

Texture

findTextureStage(name: str) → TextureStage

Returns the first TextureStage found applied to geometry at this node or below that matches the indicated name (which may contain wildcards). Returns the TextureStage if it is found, or NULL if it is not.

Return type

TextureStage

flattenLight() → int

Lightly flattens out the hierarchy below this node by applying transforms, colors, and texture matrices from the nodes onto the vertices, but does not remove any nodes.

This can result in improved rendering performance because there will be fewer transforms in the resulting scene graph, but the number of nodes will remain the same.

In particular, any NodePaths that reference nodes within this hierarchy will not be damaged. However, since this operation will remove transforms from the scene graph, it may be dangerous to apply to nodes where you expect to dynamically modify the transform, or where you expect the geometry to remain in a particular local coordinate system.

The return value is always 0, since flatten_light does not remove any nodes.

flattenMedium() → int

A more thorough flattening than flattenLight(), this first applies all the transforms, colors, and texture matrices from the nodes onto the vertices, and then removes unneeded grouping nodes–nodes that have exactly one child, for instance, but have no special properties in themselves.

This results in improved performance over flattenLight() because the number of nodes in the scene graph is reduced.

The return value is the number of nodes removed.

flattenStrong() → int

The strongest possible flattening. This first applies all of the transforms to the vertices, as in flattenMedium(), but then it will combine sibling nodes together when possible, in addition to removing unnecessary parent-child nodes. This can result in substantially fewer nodes, but any nicely-grouped hierachical bounding volumes may be lost.

It is generally a good idea to apply this kind of flattening only to nodes that will be culled largely as a single unit, like a car. Applying this to an entire scene may result in overall poorer performance because of less- effective culling.

forceRecomputeBounds() → None

Forces the recomputing of all the bounding volumes at every node in the subgraph beginning at this node and below.

This should not normally need to be called, since the bounding volumes are supposed to be recomputed automatically when necessary. It may be useful when debugging, to verify that the bounding volumes have not become inadvertently stale; it may also be useful to force animated characters to update their bounding volumes (which does not presently happen automatically).

getAncestor(index: int, current_thread: Thread) → NodePath

Returns the nth ancestor of the path, where 0 is the NodePath itself and getNumNodes() - 1 is getTop(). This requires iterating through the path.

Also see getNode(), which returns the same thing as a PandaNode pointer, not a NodePath.

Return type

NodePath

getAncestors() → list
getAntialias() → int

Returns the antialias setting that has been specifically set on this node via setAntialias(), or M_none if no setting has been made.

getAttrib(type: TypeHandle) → RenderAttrib

Returns the render attribute of the indicated type, if it is defined on the node, or NULL if it is not. This checks only what is set on this particular node level, and has nothing to do with what render attributes may be inherited from parent nodes.

Return type

RenderAttrib

getAudioVolume() → float

Returns the complete audio volume that has been applied to this node via a previous call to setAudioVolume(), or 1. (identity) if no volume has been applied to this particular node.

getBinDrawOrder() → int

Returns the drawing order associated with the bin that this particular node was assigned to via setBin(), or 0 if no bin was assigned. See setBin() and hasBin().

getBinName() → str

Returns the name of the bin that this particular node was assigned to via setBin(), or the empty string if no bin was assigned. See setBin() and hasBin().

getBounds(current_thread: Thread) → BoundingVolume

Returns a newly-allocated bounding volume containing the bottom node and all of its descendants. This is the bounding volume on the bottom arc, converted to the local coordinate space of the node.

Return type

BoundingVolume

getChild(n: int, current_thread: Thread) → NodePath

Returns a NodePath representing the nth child of the referenced node.

Return type

NodePath

getChildren(current_thread: Thread) → NodePathCollection

Returns the set of all child nodes of the referenced node.

Return type

NodePathCollection

static getClassType() → TypeHandle
Return type

TypeHandle

getCollideMask() → CollideMask

Returns the union of all of the into_collide_masks for nodes at this level and below. This is the same thing as node()->get_net_collide_mask().

If you want to return what the into_collide_mask of this node itself is, without regard to its children, use node()->get_into_collide_mask().

Return type

CollideMask

getColor() → LColor

Returns the color that has been assigned to the node, or black if no color has been assigned.

Return type

LColor

getColorScale() → LVecBase4

Returns the complete color scale vector that has been applied to this node via a previous call to setColorScale() and/or setAlphaScale(), or all 1’s (identity) if no scale has been applied to this particular node.

Return type

LVecBase4

getCommonAncestor(other: NodePath, current_thread: Thread) → NodePath

Returns the lowest NodePath that both of these two NodePaths have in common: the first ancestor that both of them share. If the two NodePaths are unrelated, returns NodePath.notFound().

Return type

NodePath

getDepthOffset() → int

Returns the depth offset value if it has been specified using set_depth_offset, or 0 if not.

getDepthTest() → bool

Returns true if depth-test rendering has been specifically set on this node via setDepthTest(), or false if depth-test rendering has been specifically disabled. If nothing has been specifically set, returns true. See also hasDepthTest().

getDepthWrite() → bool

Returns true if depth-write rendering has been specifically set on this node via setDepthWrite(), or false if depth-write rendering has been specifically disabled. If nothing has been specifically set, returns true. See also hasDepthWrite().

getDistance(other: NodePath) → float

Returns the straight-line distance between this referenced node’s coordinate frame’s origin, and that of the other node’s origin.

getEffect(type: TypeHandle) → RenderEffect

Returns the render effect of the indicated type, if it is defined on the node, or NULL if it is not.

Return type

RenderEffect

getEffects() → RenderEffects

Returns the complete RenderEffects that will be applied to this node.

Return type

RenderEffects

getErrorType() → ErrorType

If isEmpty() is true, this returns a code that represents the reason why the NodePath is empty.

Return type

ErrorType

getFog() → Fog

Returns the fog that has been set on this particular node, or NULL if no fog has been set. This is not necessarily the fog that will be applied to the geometry at or below this level, as another fog at a higher or lower level may override.

Return type

Fog

getH() → float
getH(other: NodePath) → float
getHiddenAncestor(camera_mask: DrawMask, current_thread: Thread) → NodePath

Returns the NodePath at or above the referenced node that is hidden to the indicated camera(s), or an empty NodePath if no ancestor of the referenced node is hidden (and the node should be visible).

Return type

NodePath

getHpr() → LVecBase3

Retrieves the rotation component of the transform.

Return type

LVecBase3

getHpr(other: NodePath) → LVecBase3

Returns the relative orientation of the bottom node as seen from the other node.

Return type

LVecBase3

getInstanceCount() → int

Returns the geometry instance count, or 0 if disabled. See set_instance_count.

getKey() → int

Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node instance, and different for all NodePaths that represent a different node instance.

The same key will be returned for a particular instance as long as at least one NodePath exists that represents that instance; if all NodePaths for a particular instance destruct and a new one is later created, it may have a different index. However, a given key will never be reused for a different instance (unless the app has been running long enough that we overflow the integer key value).

getLogicOp() → Operation

Returns the logical operation that has been specifically set on this node via setLogicOp(), or O_none if standard color blending has been specifically set, or if nothing has been specifically set. See also hasLogicOp(). This does not necessarily imply that the geometry will or will not be rendered with the given logical operation, as there may be other nodes that override.

Return type

Operation

getMat() → LMatrix4

Returns the transform matrix that has been applied to the referenced node, or the identity matrix if no matrix has been applied.

Return type

LMatrix4

getMat(other: NodePath) → LMatrix4

Returns the matrix that describes the coordinate space of the bottom node, relative to the other path’s bottom node’s coordinate space.

Return type

LMatrix4

getMaterial() → Material

Returns the material that has been set on this particular node, or NULL if no material has been set. This is not necessarily the material that will be applied to the geometry at or below this level, as another material at a higher or lower level may override.

See also findMaterial().

Return type

Material

static getMaxSearchDepth() → int

Returns the current setting of the search depth limit. See set_max_search_depth.

getName() → str

Returns the name of the referenced node.

getNetAudioVolume() → float

Returns the complete audio volume for this node taking highers nodes in the graph into account.

getNetPrevTransform(current_thread: Thread) → TransformState

Returns the net “previous” transform on this node from the root. See setPrevTransform().

Return type

TransformState

getNetPythonTag(keys: object) → object
getNetState(current_thread: Thread) → RenderState

Returns the net state on this node from the root.

Return type

RenderState

getNetTag(key: str) → str

Returns the tag value that has been defined on this node, or the nearest ancestor node, for the indicated key. If no value has been defined for the indicated key on any ancestor node, returns the empty string. See also getTag().

getNetTransform(current_thread: Thread) → TransformState

Returns the net transform on this node from the root.

Return type

TransformState

getNode(index: int, current_thread: Thread) → PandaNode

Returns the nth node of the path, where 0 is the referenced (bottom) node and getNumNodes() - 1 is the top node. This requires iterating through the path.

Also see node(), which is a convenience function to return the same thing as get_node(0) (since the bottom node is the most important node in the NodePath, and is the one most frequently referenced).

Note that this function returns the same thing as get_ancestor(index).:meth:~NodePath.node.

Return type

PandaNode

getNodes() → list
getNumChildren(current_thread: Thread) → int

Returns the number of children of the referenced node.

getNumNodes(current_thread: Thread) → int

Returns the number of nodes in the path.

getP() → float
getP(other: NodePath) → float
getParent(current_thread: Thread) → NodePath

Returns the NodePath to the parent of the referenced node: that is, this NodePath, shortened by one node. The parent of a singleton NodePath is defined to be the empty NodePath.

Return type

NodePath

getPos() → LPoint3

Retrieves the translation component of the transform.

Return type

LPoint3

getPos(other: NodePath) → LPoint3

Returns the relative position of the referenced node as seen from the other node.

Return type

LPoint3

getPosDelta() → LVector3

Returns the delta vector from this node’s position in the previous frame (according to setPrevTransform(), typically set via the use of setFluidPos()) and its position in the current frame. This is the vector used to determine collisions. Generally, if the node was last repositioned via setPos(), the delta will be zero; if it was adjusted via setFluidPos(), the delta will represent the change from the previous frame’s position.

Return type

LVector3

getPosDelta(other: NodePath) → LVector3

Returns the delta vector from this node’s position in the previous frame (according to setPrevTransform(), typically set via the use of setFluidPos()) and its position in the current frame, as seen in the indicated node’s coordinate space. This is the vector used to determine collisions. Generally, if the node was last repositioned via setPos(), the delta will be zero; if it was adjusted via setFluidPos(), the delta will represent the change from the previous frame’s position.

Return type

LVector3

getPrevTransform(other: NodePath, current_thread: Thread) → TransformState

Returns the relative “previous” transform to this node from the other node; i.e. the position of this node in the previous frame, as seen by the other node in the previous frame.

Return type

TransformState

getPrevTransform(current_thread: Thread) → TransformState

Returns the transform that has been set as this node’s “previous” position. See setPrevTransform().

Return type

TransformState

getPythonTag(keys: object) → object
getPythonTagKeys() → object
getPythonTags() → object
getQuat() → LQuaternion

Retrieves the rotation component of the transform.

Return type

LQuaternion

getQuat(other: NodePath) → LQuaternion

Returns the relative orientation of the bottom node as seen from the other node.

Return type

LQuaternion

getR() → float
getR(other: NodePath) → float
getRelativePoint(other: NodePath, point: LVecBase3) → LPoint3

Given that the indicated point is in the coordinate system of the other node, returns the same point in this node’s coordinate system.

Return type

LPoint3

getRelativeVector(other: NodePath, vec: LVecBase3) → LVector3

Given that the indicated vector is in the coordinate system of the other node, returns the same vector in this node’s coordinate system.

Return type

LVector3

getRenderMode() → Mode

Returns the render mode that has been specifically set on this node via setRenderMode(), or M_unchanged if nothing has been set.

Return type

Mode

getRenderModePerspective() → bool

Returns the flag that has been set on this node via setRenderModePerspective(), or false if no flag has been set.

getRenderModeThickness() → float

Returns the render mode thickness that has been specifically set on this node via setRenderMode(), or 1.0 if nothing has been set.

getSa() → float

Gets the alpha scale component of the transform

getSb() → float

Gets the blue scale component of the transform

getScale() → LVecBase3

Retrieves the scale component of the transform.

Return type

LVecBase3

getScale(other: NodePath) → LVecBase3

Returns the relative scale of the bottom node as seen from the other node.

Return type

LVecBase3

getSg() → float

Gets the green scale component of the transform

getShader() → Shader
Return type

Shader

getShaderInput(id: InternalName) → ShaderInput
Return type

ShaderInput

getShear() → LVecBase3

Retrieves the shear component of the transform.

Return type

LVecBase3

getShear(other: NodePath) → LVecBase3

Returns the relative shear of the bottom node as seen from the other node.

Return type

LVecBase3

getShxy() → float
getShxy(other: NodePath) → float

Returns the relative shear of the referenced node as seen from the other node.

getShxz() → float
getShxz(other: NodePath) → float
getShyz() → float
getShyz(other: NodePath) → float
getSort(current_thread: Thread) → int

Returns the sort value of the referenced node within its parent; that is, the sort number passed on the last reparenting operation for this node. This will control the position of the node within its parent’s list of children.

getSr() → float

Gets the red scale component of the transform

getStashedAncestor(current_thread: Thread) → NodePath

Returns the NodePath at or above the referenced node that is stashed, or an empty NodePath if no ancestor of the referenced node is stashed (and the node should be visible).

Return type

NodePath

getStashedChildren(current_thread: Thread) → NodePathCollection

Returns the set of all child nodes of the referenced node that have been stashed. These children are not normally visible on the node, and do not appear in the list returned by getChildren().

Return type

NodePathCollection

getState(other: NodePath, current_thread: Thread) → RenderState

Returns the state changes that must be made to transition to the render state of this node from the render state of the other node.

Return type

RenderState

getState(current_thread: Thread) → RenderState

Returns the complete state object set on this node.

Return type

RenderState

getSx() → float
getSx(other: NodePath) → float

Returns the relative scale of the referenced node as seen from the other node.

getSy() → float
getSy(other: NodePath) → float
getSz() → float
getSz(other: NodePath) → float
getTag(key: str) → str

Retrieves the user-defined value that was previously set on this node for the particular key, if any. If no value has been previously set, returns the empty string. See also getNetTag().

getTagKeys() → object
getTagKeys(keys: vector_string) → None

Fills the given vector up with the list of tags on this PandaNode.

It is the user’s responsibility to ensure that the keys vector is empty before making this call; otherwise, the new files will be appended to it.

getTags() → object
getTexGen(stage: TextureStage) → TexGenMode

Returns the texture coordinate generation mode for the given stage, or M_off if there is no explicit mode set for the given stage.

Return type

TexGenMode

getTexHpr(other: NodePath, stage: TextureStage) → LVecBase3

Returns the 3-D HPR set for the UVW’s for the given stage on the current node.

This call is appropriate for 3-d texture coordinates.

Return type

LVecBase3

getTexHpr(stage: TextureStage) → LVecBase3

Returns the 3-D HPR set for the UVW’s for the given stage on the current node.

This call is appropriate for 3-d texture coordinates.

Return type

LVecBase3

getTexOffset(other: NodePath, stage: TextureStage) → LVecBase2

Returns the offset set for the UV’s for the given stage on the current node.

This call is appropriate for ordinary 2-d texture coordinates.

Return type

LVecBase2

getTexOffset(stage: TextureStage) → LVecBase2

Returns the offset set for the UV’s for the given stage on the current node.

This call is appropriate for ordinary 2-d texture coordinates.

Return type

LVecBase2

getTexPos(other: NodePath, stage: TextureStage) → LVecBase3

Returns the offset set for the UVW’s for the given stage on the current node.

This call is appropriate for 3-d texture coordinates.

Return type

LVecBase3

getTexPos(stage: TextureStage) → LVecBase3

Returns the offset set for the UVW’s for the given stage on the current node.

This call is appropriate for 3-d texture coordinates.

Return type

LVecBase3

getTexProjectorFrom(stage: TextureStage) → NodePath

Returns the “from” node associated with the TexProjectorEffect on the indicated stage. The relative transform between the “from” and the “to” nodes is automatically applied to the texture transform each frame.

Return type

NodePath

getTexProjectorTo(stage: TextureStage) → NodePath

Returns the “to” node associated with the TexProjectorEffect on the indicated stage. The relative transform between the “from” and the “to” nodes is automatically applied to the texture transform each frame.

Return type

NodePath

getTexRotate(other: NodePath, stage: TextureStage) → float

Returns the rotation set for the UV’s for the given stage on the current node.

This call is appropriate for ordinary 2-d texture coordinates.

getTexRotate(stage: TextureStage) → float

Returns the rotation set for the UV’s for the given stage on the current node.

This call is appropriate for ordinary 2-d texture coordinates.

getTexScale(other: NodePath, stage: TextureStage) → LVecBase2

Returns the scale set for the UV’s for the given stage on the current node.

This call is appropriate for ordinary 2-d texture coordinates.

Return type

LVecBase2

getTexScale(stage: TextureStage) → LVecBase2

Returns the scale set for the UV’s for the given stage on the current node.

This call is appropriate for ordinary 2-d texture coordinates.

Return type

LVecBase2

getTexScale3d(other: NodePath, stage: TextureStage) → LVecBase3

Returns the scale set for the UVW’s for the given stage on the current node.

This call is appropriate for 3-d texture coordinates.

Return type

LVecBase3

getTexScale3d(stage: TextureStage) → LVecBase3

Returns the scale set for the UVW’s for the given stage on the current node.

This call is appropriate for 3-d texture coordinates.

Return type

LVecBase3

getTexTransform(other: NodePath, stage: TextureStage) → TransformState

Returns the texture matrix on the current node for the given stage, relative to the other node.

Return type

TransformState

getTexTransform(stage: TextureStage) → TransformState

Returns the texture matrix on the current node for the given stage, or identity transform if there is no explicit transform set for the given stage.

Return type

TransformState

getTexture() → Texture

Returns the base-level texture that has been set on this particular node, or NULL if no texture has been set. This is not necessarily the texture that will be applied to the geometry at or below this level, as another texture at a higher or lower level may override.

See also findTexture().

Return type

Texture

getTexture(stage: TextureStage) → Texture

Returns the texture that has been set on the indicated stage for this particular node, or NULL if no texture has been set for this stage.

Return type

Texture

getTextureSampler() → SamplerState

Returns the sampler state that has been given for the base-level texture that has been set on this particular node. If no sampler state was given, this returns the texture’s default sampler settings.

It is an error to call this if there is no base-level texture applied to this particular node.

Return type

SamplerState

getTextureSampler(stage: TextureStage) → SamplerState

Returns the sampler state that has been given for the indicated texture stage that has been set on this particular node. If no sampler state was given, this returns the texture’s default sampler settings.

It is an error to call this if there is no texture set for this stage on this particular node.

Return type

SamplerState

getTightBounds(other: NodePath) → object
getTop(current_thread: Thread) → NodePath

Returns a singleton NodePath that represents the top of the path, or empty NodePath if this path is empty.

Return type

NodePath

getTopNode(current_thread: Thread) → PandaNode

Returns the top node of the path, or NULL if the path is empty. This requires iterating through the path.

Return type

PandaNode

getTransform(other: NodePath, current_thread: Thread) → TransformState

Returns the relative transform to this node from the other node; i.e. the transformation of this node as seen from the other node.

Return type

TransformState

getTransform(current_thread: Thread) → TransformState

Returns the complete transform object set on this node.

Return type

TransformState

getTransparency() → Mode

Returns the transparent rendering that has been specifically set on this node via setTransparency(), or M_none if nontransparent rendering has been specifically set, or if nothing has been specifically set. See also hasTransparency(). This does not necessarily imply that the geometry will or will not be rendered transparent, as there may be other nodes that override.

Return type

Mode

getTwoSided() → bool

Returns true if two-sided rendering has been specifically set on this node via setTwoSided(), or false if one-sided rendering has been specifically set, or if nothing has been specifically set. See also hasTwoSided(). This does not necessarily imply that the geometry will or will not be rendered two-sided, as there may be other nodes that override.

getX() → float
getX(other: NodePath) → float
getY() → float
getY(other: NodePath) → float
getZ() → float
getZ(other: NodePath) → float
hasAntialias() → bool

Returns true if an antialias setting has been explicitly mode on this particular node via setAntialias(). If this returns true, then getAntialias() may be called to determine what the setting was.

hasAttrib(type: TypeHandle) → bool

Returns true if there is a render attribute of the indicated type defined on this node, or false if there is not.

hasAudioVolume() → bool

Returns true if an audio volume has been applied to the referenced node, false otherwise. It is still possible that volume at this node might have been scaled by an ancestor node.

hasBillboard() → bool

Returns true if there is any billboard effect on the node.

hasBin() → bool

Returns true if the node has been assigned to the a particular rendering bin via setBin(), false otherwise.

hasClipPlane(clip_plane: NodePath) → bool

Returns true if the indicated clipping plane has been specifically applied to this particular node. This means that someone called setClipPlane() on this node with the indicated clip_plane.

hasClipPlaneOff() → bool

Returns true if all clipping planes have been specifically disabled on this particular node. This means that someone called setClipPlaneOff() on this node with no parameters.

hasClipPlaneOff(clip_plane: NodePath) → bool

Returns true if the indicated clipping plane has been specifically disabled on this particular node. This means that someone called setClipPlaneOff() on this node with the indicated clip_plane.

hasColor() → bool

Returns true if a color has been applied to the given node, false otherwise.

hasColorScale() → bool

Returns true if a color scale has been applied to the referenced node, false otherwise. It is still possible that color at this node might have been scaled by an ancestor node.

hasCompass() → bool

Returns true if there is any compass effect on the node.

hasDepthOffset() → bool

Returns true if a depth-offset adjustment has been explicitly set on this particular node via setDepthOffset(). If this returns true, then getDepthOffset() may be called to determine which has been set.

hasDepthTest() → bool

Returns true if a depth-test adjustment has been explicitly set on this particular node via setDepthTest(). If this returns true, then getDepthTest() may be called to determine which has been set.

hasDepthWrite() → bool

Returns true if a depth-write adjustment has been explicitly set on this particular node via setDepthWrite(). If this returns true, then getDepthWrite() may be called to determine which has been set.

hasEffect(type: TypeHandle) → bool

Returns true if there is a render effect of the indicated type defined on this node, or false if there is not.

hasFog() → bool

Returns true if a fog has been applied to this particular node via setFog(), false otherwise. This is not the same thing as asking whether the geometry at this node will be rendered with fog, as there may be a fog in effect from a higher or lower level.

hasFogOff() → bool

Returns true if a fog has been specifically disabled on this particular node via setFogOff(), false otherwise. This is not the same thing as asking whether the geometry at this node will be rendered unfogged, as there may be a fog in effect from a higher or lower level.

hasLight(light: NodePath) → bool

Returns true if the indicated Light or PolylightNode has been specifically enabled on this particular node. This means that someone called setLight() on this node with the indicated light.

hasLightOff() → bool

Returns true if all Lights have been specifically disabled on this particular node. This means that someone called setLightOff() on this node with no parameters.

hasLightOff(light: NodePath) → bool

Returns true if the indicated Light has been specifically disabled on this particular node. This means that someone called setLightOff() on this node with the indicated light.

This interface does not support PolylightNodes, which cannot be turned off at a lower level.

hasLogicOp() → bool

Returns true if a logical operation has been explicitly set on this particular node via setLogicOp(). If this returns true, then getLogicOp() may be called to determine whether a logical operation has been explicitly disabled for this node or set to particular operation.

hasMat() → bool

Returns true if a non-identity transform matrix has been applied to the referenced node, false otherwise.

hasMaterial() → bool

Returns true if a material has been applied to this particular node via setMaterial(), false otherwise.

hasNetPythonTag(keys: object) → bool
hasNetTag(key: str) → bool

Returns true if the indicated tag value has been defined on this node or on any ancestor node, or false otherwise. See also hasTag().

hasOccluder(occluder: NodePath) → bool

Returns true if the indicated occluder has been specifically applied to this particular node. This means that someone called setOccluder() on this node with the indicated occluder.

hasParent(current_thread: Thread) → bool

Returns true if the referenced node has a parent; i.e. the NodePath chain contains at least two nodes.

hasPythonTag(keys: object) → bool
hasRenderMode() → bool

Returns true if a render mode has been explicitly set on this particular node via setRenderMode() (or setRenderModeWireframe() or setRenderModeFilled()), false otherwise.

hasScissor() → bool

Returns true if a scissor region was defined at this node by a previous call to setScissor(). This does not check for scissor regions inherited from a parent class. It also does not check for the presence of a low- level ScissorAttrib, which is different from the ScissorEffect added by set_scissor.

hasTag(key: str) → bool

Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set. See also hasNetTag().

hasTexGen(stage: TextureStage) → bool

Returns true if there is a mode for automatic texture coordinate generation on the current node for the given stage.

hasTexProjector(stage: TextureStage) → bool

Returns true if this node has a TexProjectorEffect for the indicated stage, false otherwise.

hasTexTransform(stage: TextureStage) → bool

Returns true if there is an explicit texture matrix on the current node for the given stage.

hasTexcoord(texcoord_name: str) → bool

Returns true if there are at least some vertices at this node and below that use the named texture coordinate set, false otherwise. Pass the empty string for the default texture coordinate set.

hasTexture() → bool

Returns true if a texture has been applied to this particular node via setTexture(), false otherwise. This is not the same thing as asking whether the geometry at this node will be rendered with texturing, as there may be a texture in effect from a higher or lower level.

hasTexture(stage: TextureStage) → bool

Returns true if texturing has been specifically enabled on this particular node for the indicated stage. This means that someone called setTexture() on this node with the indicated stage name, or the stage_name is the default stage_name, and someone called setTexture() on this node.

hasTextureOff() → bool

Returns true if texturing has been specifically disabled on this particular node via setTextureOff(), false otherwise. This is not the same thing as asking whether the geometry at this node will be rendered untextured, as there may be a texture in effect from a higher or lower level.

hasTextureOff(stage: TextureStage) → bool

Returns true if texturing has been specifically disabled on this particular node for the indicated stage. This means that someone called setTextureOff() on this node with the indicated stage name, or that someone called setTextureOff() on this node to remove all stages.

hasTransparency() → bool

Returns true if a transparent-rendering adjustment has been explicitly set on this particular node via setTransparency(). If this returns true, then getTransparency() may be called to determine whether transparency has been explicitly enabled or explicitly disabled for this node.

hasTwoSided() → bool

Returns true if a two-sided adjustment has been explicitly set on this particular node via setTwoSided(). If this returns true, then getTwoSided() may be called to determine which has been set.

hasVertexColumn(name: InternalName) → bool

Returns true if there are at least some vertices at this node and below that contain a reference to the indicated vertex data column name, false otherwise.

This is particularly useful for testing whether a particular model has a given texture coordinate set (but see hasTexcoord()).

headsUp(point: LPoint3, up: LVector3) → None

Behaves like lookAt(), but with a strong preference to keeping the up vector oriented in the indicated “up” direction.

headsUp(other: NodePath, point: LPoint3, up: LVector3) → None

Behaves like lookAt(), but with a strong preference to keeping the up vector oriented in the indicated “up” direction.

headsUp(other: NodePath, x: float, y: float, z: float) → None

Behaves like lookAt(), but with a strong preference to keeping the up vector oriented in the indicated “up” direction.

headsUp(x: float, y: float, z: float) → None

Behaves like lookAt(), but with a strong preference to keeping the up vector oriented in the indicated “up” direction.

hide() → None

Makes the referenced node (and the entire subgraph below this node) invisible to all cameras. It remains part of the scene graph, its bounding volume still contributes to its parent’s bounding volume, and it will still be involved in collision tests.

hide(camera_mask: DrawMask) → None

Makes the referenced node invisible just to the cameras whose camera_mask shares the indicated bits.

This will also hide any nodes below this node in the scene graph, including those nodes for which show() has been called, but it will not hide descendent nodes for which showThrough() has been called.

hideBounds() → None

Stops the rendering of the bounding volume begun with showBounds().

instanceTo(other: NodePath, sort: int, current_thread: Thread) → NodePath

Adds the referenced node of the NodePath as a child of the referenced node of the indicated other NodePath. Any other parent-child relations of the node are unchanged; in particular, the node is not removed from its existing parent, if any.

If the node already had an existing parent, this method will create a new instance of the node within the scene graph.

This does not change the NodePath itself, but does return a new NodePath that reflects the new instance node.

If the destination NodePath is empty, this creates a new instance which is not yet parented to any node. A new instance of this sort cannot easily be differentiated from other similar instances, but it is nevertheless a different instance and it will return a different get_id() value.

If the referenced node is already a child of the indicated NodePath, returns that already-existing instance, unstashing it first if necessary.

Return type

NodePath

instanceUnderNode(other: NodePath, name: str, sort: int, current_thread: Thread) → NodePath

Behaves like instanceTo(), but implicitly creates a new node to instance the geometry under, and returns a NodePath to that new node. This allows the programmer to set a unique state and/or transform on this instance.

Return type

NodePath

isAncestorOf(other: NodePath, current_thread: Thread) → bool

Returns true if the node represented by this NodePath is a parent or other ancestor of the other NodePath, or false if it is not.

isEmpty() → bool

Returns true if the NodePath contains no nodes.

isHidden(camera_mask: DrawMask) → bool

Returns true if the referenced node is hidden from the indicated camera(s) either directly, or because some ancestor is hidden.

isSameGraph(other: NodePath, current_thread: Thread) → bool

Returns true if the node represented by this NodePath is parented within the same graph as that of the other NodePath. This is essentially the same thing as asking whether getTop() of both NodePaths is the same (e.g., both “render”).

isSingleton(current_thread: Thread) → bool

Returns true if the NodePath contains exactly one node.

isStashed() → bool

Returns true if the referenced node is stashed either directly, or because some ancestor is stashed.

listTags() → None

Lists the tags to the nout stream, one per line. See PandaNode.listTags() for a variant that allows you to specify the output stream.

lookAt(point: LPoint3, up: LVector3) → None

Sets the hpr on this NodePath so that it rotates to face the indicated point in space.

lookAt(other: NodePath, point: LPoint3, up: LVector3) → None

Sets the transform on this NodePath so that it rotates to face the indicated point in space, which is relative to the other NodePath.

lookAt(other: NodePath, x: float, y: float, z: float) → None

Sets the hpr on this NodePath so that it rotates to face the indicated point in space, which is relative to the other NodePath.

lookAt(x: float, y: float, z: float) → None

Sets the transform on this NodePath so that it rotates to face the indicated point in space. This will overwrite any previously existing scale on the node, although it will preserve any translation.

ls() → None

Lists the hierarchy at and below the referenced node.

ls(out: ostream, indent_level: int) → None

Lists the hierarchy at and below the referenced node.

property name
Getter

Returns the name of the referenced node.

Setter

Changes the name of the referenced node.

Return type

string

property net_tags

Returns the tag value that has been defined on this node, or the nearest ancestor node, for the indicated key. If no value has been defined for the indicated key on any ancestor node, returns the empty string. See also getTag().

Return type

Mapping[string]

node() → PandaNode

Returns the referenced node of the path.

Return type

PandaNode

property nodes

Returns the nth node of the path, where 0 is the referenced (bottom) node and getNumNodes() - 1 is the top node. This requires iterating through the path.

Also see node(), which is a convenience function to return the same thing as get_node(0) (since the bottom node is the most important node in the NodePath, and is the one most frequently referenced).

Note that this function returns the same thing as get_ancestor(index).:meth:~NodePath.node.

Return type

Sequence[PandaNode]

static notFound() → NodePath

Creates a NodePath with the ET_not_found error type set.

Return type

NodePath

output(out: ostream) → None

Writes a sensible description of the NodePath to the indicated output stream.

property parent

Returns the NodePath to the parent of the referenced node: that is, this NodePath, shortened by one node. The parent of a singleton NodePath is defined to be the empty NodePath.

Return type

NodePath

premungeScene(gsg: GraphicsStateGuardianBase) → None

Walks through the scene graph beginning at the bottom node, and internally adjusts any GeomVertexFormats for optimal rendering on the indicated GSG. If this step is not done prior to rendering, the formats will be optimized at render time instead, for a small cost.

It is not normally necessary to do this on a model loaded directly from disk, since the loader will do this by default.

prepareScene(gsg: GraphicsStateGuardianBase) → None

Walks through the scene graph beginning at the bottom node, and does whatever initialization is required to render the scene properly with the indicated GSG. It is not strictly necessary to call this, since the GSG will initialize itself when the scene is rendered, but this may take some of the overhead away from that process.

In particular, this will ensure that textures and vertex buffers within the scene are loaded into graphics memory.

projectTexture(stage: TextureStage, tex: Texture, projector: NodePath) → None

A convenience function to enable projective texturing at this node level and below, using the indicated NodePath (which should contain a LensNode) as the projector.

property python_tags
removeNode(current_thread: Thread) → None

Disconnects the referenced node from the scene graph. This will also delete the node if there are no other pointers to it.

Normally, this should be called only when you are really done with the node. If you want to remove a node from the scene graph but keep it around for later, you should probably use detachNode() instead.

In practice, the only difference between removeNode() and detachNode() is that removeNode() also resets the NodePath to empty, which will cause the node to be deleted immediately if there are no other references. On the other hand, detachNode() leaves the NodePath referencing the node, which will keep at least one reference to the node for as long as the NodePath exists.

static removed() → NodePath

Creates a NodePath with the ET_removed error type set.

Return type

NodePath

reparentTo(other: NodePath, sort: int, current_thread: Thread) → None

Removes the referenced node of the NodePath from its current parent and attaches it to the referenced node of the indicated NodePath.

If the destination NodePath is empty, this is the same thing as detachNode().

If the referenced node is already a child of the indicated NodePath (via some other instance), this operation fails and leaves the NodePath detached.

replaceMaterial(mat: Material, new_mat: Material) → None

Recursively searches the scene graph for references to the given material, and replaces them with the new material.

replaceTexture(tex: Texture, new_tex: Texture) → None

Recursively searches the scene graph for references to the given texture, and replaces them with the new texture.

New in version 1.10.4.

reverseLs() → None

Lists the hierarchy at and above the referenced node.

reverseLs(out: ostream, indent_level: int) → int

Lists the hierarchy at and above the referenced node.

setAllColorScale(scale: float, priority: int) → None

Scales all the color components of the object by the same amount, darkening the object, without (much) affecting alpha. Note that any priority specified will also apply to the alpha scale.

setAlphaScale(scale: float, priority: int) → None

Sets the alpha scale component of the transform without (much) affecting the color scale. Note that any priority specified will also apply to the color scale.

setAntialias(mode: int, priority: int) → None

Specifies the antialiasing type that should be applied at this node and below. See AntialiasAttrib.

setAttrib(attrib: RenderAttrib, priority: int) → None

Adds the indicated render attribute to the scene graph on this node. This attribute will now apply to this node and everything below. If there was already an attribute of the same type, it is replaced.

setAudioVolume(volume: float, priority: int) → None

Sets the audio volume component of the transform

setAudioVolumeOff(priority: int) → None

Disables any audio volume attribute inherited from above. This is not the same thing as clearAudioVolume(), which undoes any previous setAudioVolume() operation on this node; rather, this actively disables any setAudioVolume() that might be inherited from a parent node.

It is legal to specify a new volume on the same node with a subsequent call to setAudioVolume(); this new scale will apply to lower nodes.

setBillboardAxis(camera: NodePath, offset: float) → None

Puts a billboard transition on the node such that it will rotate in two dimensions around the up axis, towards a specified “camera” instead of to the viewing camera.

setBillboardAxis(offset: float) → None

Puts a billboard transition on the node such that it will rotate in two dimensions around the up axis.

setBillboardPointEye(camera: NodePath, offset: float, fixed_depth: bool) → None

Puts a billboard transition on the node such that it will rotate in three dimensions about the origin, keeping its up vector oriented to the top of the camera, towards a specified “camera” instead of to the viewing camera.

setBillboardPointEye(offset: float, fixed_depth: bool) → None

Puts a billboard transition on the node such that it will rotate in three dimensions about the origin, keeping its up vector oriented to the top of the camera.

setBillboardPointWorld(camera: NodePath, offset: float) → None

Puts a billboard transition on the node such that it will rotate in three dimensions about the origin, keeping its up vector oriented to the sky, towards a specified “camera” instead of to the viewing camera.

setBillboardPointWorld(offset: float) → None

Puts a billboard transition on the node such that it will rotate in three dimensions about the origin, keeping its up vector oriented to the sky.

setBin(bin_name: str, draw_order: int, priority: int) → None

Assigns the geometry at this level and below to the named rendering bin. It is the user’s responsibility to ensure that such a bin already exists, either via the cull-bin Configrc variable, or by explicitly creating a GeomBin of the appropriate type at runtime.

There are two default bins created when Panda is started: “default” and “fixed”. Normally, all geometry is assigned to “default” unless specified otherwise. This bin renders opaque geometry in state-sorted order, followed by transparent geometry sorted back-to-front. If any geometry is assigned to “fixed”, this will be rendered following all the geometry in “default”, in the order specified by draw_order for each piece of geometry so assigned.

The draw_order parameter is meaningful only for GeomBinFixed type bins, e.g. “fixed”. Other kinds of bins ignore it.

setClipPlane(clip_plane: NodePath, priority: int) → None

Adds the indicated clipping plane to the list of planes that apply to geometry at this node and below. The clipping plane itself, a PlaneNode, should be parented into the scene graph elsewhere, to represent the plane’s position in space; but until setClipPlane() is called it will clip no geometry.

setClipPlaneOff(clip_plane: NodePath, priority: int) → None

Sets the geometry at this level and below to render without being clipped by the indicated PlaneNode. This is different from not specifying the PlaneNode; rather, this specifically contradicts setClipPlane() at a higher node level (or, with a priority, overrides a setClipPlane() at a lower level).

setClipPlaneOff(priority: int) → None

Sets the geometry at this level and below to render using no clip_planes at all. This is different from not specifying a clip_plane; rather, this specifically contradicts setClipPlane() at a higher node level (or, with a priority, overrides a setClipPlane() at a lower level).

If no clip_planes are in effect on a particular piece of geometry, that geometry is rendered without being clipped (other than by the viewing frustum).

setCollideMask(new_mask: CollideMask, bits_to_change: CollideMask, node_type: TypeHandle) → None

Recursively applies the indicated CollideMask to the into_collide_masks for all nodes at this level and below. If node_type is not TypeHandle.none(), then only nodes matching (or inheriting from) the indicated PandaNode subclass are modified.

The default is to change all bits, but if bits_to_change is not all bits on, then only the bits that are set in bits_to_change are modified, allowing this call to change only a subset of the bits in the subgraph.

setColor(color: LColor, priority: int) → None

Applies a scene-graph color to the referenced node. This color will apply to all geometry at this level and below (that does not specify a new color or a setColorOff()).

setColor(r: float, g: float, b: float, a: float, priority: int) → None

Applies a scene-graph color to the referenced node. This color will apply to all geometry at this level and below (that does not specify a new color or a setColorOff()).

setColorOff(priority: int) → None

Sets the geometry at this level and below to render using the geometry color. This is normally the default, but it may be useful to use this to contradict setColor() at a higher node level (or, with a priority, to override a setColor() at a lower level).

setColorScale(scale: LVecBase4, priority: int) → None

Sets the color scale component of the transform, leaving translation and rotation untouched.

setColorScale(sx: float, sy: float, sz: float, sa: float, priority: int) → None

Sets the color scale component of the transform

setColorScaleOff(priority: int) → None

Disables any color scale attribute inherited from above. This is not the same thing as clearColorScale(), which undoes any previous setColorScale() operation on this node; rather, this actively disables any setColorScale() that might be inherited from a parent node. This also disables setAlphaScale() at the same time.

It is legal to specify a new color scale on the same node with a subsequent call to setColorScale() or setAlphaScale(); this new scale will apply to lower geometry.

setCompass(reference: NodePath) → None

Puts a compass effect on the node, so that it will retain a fixed rotation relative to the reference node (or render if the reference node is empty) regardless of the transforms above it.

setDepthOffset(bias: int, priority: int) → None

This instructs the graphics driver to apply an offset or bias to the generated depth values for rendered polygons, before they are written to the depth buffer. This can be used to shift polygons forward slightly, to resolve depth conflicts, or self-shadowing artifacts on thin objects. The bias is always an integer number, and each integer increment represents the smallest possible increment in Z that is sufficient to completely resolve two coplanar polygons. Positive numbers are closer towards the camera.

setDepthTest(depth_test: bool, priority: int) → None

Specifically sets or disables the testing of the depth buffer on this particular node. This is normally on in the 3-d scene graph and off in the 2-d scene graph; it should be on for rendering most 3-d objects properly.

setDepthWrite(depth_write: bool, priority: int) → None

Specifically sets or disables the writing to the depth buffer on this particular node. This is normally on in the 3-d scene graph and off in the 2-d scene graph; it should be on for rendering most 3-d objects properly.

setEffect(effect: RenderEffect) → None

Adds the indicated render effect to the scene graph on this node. If there was already an effect of the same type, it is replaced.

setEffects(effects: RenderEffects) → None

Sets the complete RenderEffects that will be applied this node. This completely replaces whatever has been set on this node via repeated calls to setAttrib().

setFluidPos(pos: LVecBase3) → None

Sets the translation component, without changing the “previous” position, so that the collision system will see the node as moving fluidly from its previous position to its new position. See Also: NodePath.setPos()

setFluidPos(other: NodePath, pos: LVecBase3) → None

Sets the translation component of the transform, relative to the other node.

setFluidPos(other: NodePath, x: float, y: float, z: float) → None

Sets the translation component, without changing the “previous” position, so that the collision system will see the node as moving fluidly from its previous position to its new position.

setFluidPos(x: float, y: float, z: float) → None

Sets the translation component, without changing the “previous” position, so that the collision system will see the node as moving fluidly from its previous position to its new position.

setFluidX(other: NodePath, x: float) → None
setFluidX(x: float) → None
setFluidY(other: NodePath, y: float) → None
setFluidY(y: float) → None
setFluidZ(other: NodePath, z: float) → None
setFluidZ(z: float) → None
setFog(fog: Fog, priority: int) → None

Sets the geometry at this level and below to render using the indicated fog.

setFogOff(priority: int) → None

Sets the geometry at this level and below to render using no fog. This is normally the default, but it may be useful to use this to contradict setFog() at a higher node level (or, with a priority, to override a setFog() at a lower level).

setH(other: NodePath, h: float) → None
setH(h: float) → None
setHpr(hpr: LVecBase3) → None

Sets the rotation component of the transform, leaving translation and scale untouched.

setHpr(other: NodePath, hpr: LVecBase3) → None

Sets the rotation component of the transform, relative to the other node.

setHpr(other: NodePath, h: float, p: float, r: float) → None

Sets the rotation component of the transform, relative to the other node.

setHpr(h: float, p: float, r: float) → None

Sets the rotation component of the transform, leaving translation and scale untouched.

setHprScale(hpr: LVecBase3, scale: LVecBase3) → None

Sets the rotation and scale components of the transform, leaving translation untouched.

setHprScale(other: NodePath, hpr: LVecBase3, scale: LVecBase3) → None

Sets the rotation and scale components of the transform, leaving translation untouched. This, or set_pos_hpr_scale, is the preferred way to update a transform when both hpr and scale are to be changed.

setHprScale(other: NodePath, h: float, p: float, r: float, sx: float, sy: float, sz: float) → None

Sets the rotation and scale components of the transform, leaving translation untouched. This, or set_pos_hpr_scale, is the preferred way to update a transform when both hpr and scale are to be changed.

setHprScale(h: float, p: float, r: float, sx: float, sy: float, sz: float) → None

Sets the rotation and scale components of the transform, leaving translation untouched.

setInstanceCount(instance_count: int) → None

Sets the geometry instance count, or 0 if geometry instancing should be disabled. Do not confuse with instanceTo which only applies to animation instancing.

setLight(light: NodePath, priority: int) → None

Adds the indicated Light or PolylightNode to the list of lights that illuminate geometry at this node and below. The light itself should be parented into the scene graph elsewhere, to represent the light’s position in space; but until setLight() is called it will illuminate no geometry.

setLightOff(light: NodePath, priority: int) → None

Sets the geometry at this level and below to render without using the indicated Light. This is different from not specifying the Light; rather, this specifically contradicts setLight() at a higher node level (or, with a priority, overrides a setLight() at a lower level).

This interface does not support PolylightNodes, which cannot be turned off at a lower level.

setLightOff(priority: int) → None

Sets the geometry at this level and below to render using no lights at all. This is different from not specifying a light; rather, this specifically contradicts setLight() at a higher node level (or, with a priority, overrides a setLight() at a lower level).

If no lights are in effect on a particular piece of geometry, that geometry is rendered with lighting disabled.

setLogicOp(op: Operation, priority: int) → None

Specifically sets or disables a logical operation on this particular node. If no other nodes override, this will cause geometry to be rendered without color blending but instead using the given logical operator.

setMat(mat: LMatrix4) → None

Directly sets an arbitrary 4x4 transform matrix.

setMat(other: NodePath, mat: LMatrix4) → None

Converts the indicated matrix from the other’s coordinate space to the local coordinate space, and applies it to the node.

setMaterial(tex: Material, priority: int) → None

Sets the geometry at this level and below to render using the indicated material.

Previously, this operation made a copy of the material structure, but nowadays it assigns the pointer directly.

setMaterialOff(priority: int) → None

Sets the geometry at this level and below to render using no material. This is normally the default, but it may be useful to use this to contradict setMaterial() at a higher node level (or, with a priority, to override a setMaterial() at a lower level).

static setMaxSearchDepth(max_search_depth: int) → None

Certain operations, such as find() or findAllMatches(), require a traversal of the scene graph to search for the target node or nodes. This traversal does not attempt to detect cycles, so an arbitrary cap is set on the depth of the traversal as a poor man’s cycle detection, in the event that a cycle has inadvertently been introduced into the scene graph.

There may be other reasons you’d want to truncate a search before the bottom of the scene graph has been reached. In any event, this function sets the limit on the number of levels that a traversal will continue, and hence the maximum length of a path that may be returned by a traversal.

This is a static method, and so changing this parameter affects all of the NodePaths in the universe.

setName(name: str) → None

Changes the name of the referenced node.

setOccluder(occluder: NodePath) → None

Adds the indicated occluder to the list of occluders that apply to geometry at this node and below. The occluder itself, an OccluderNode, should be parented into the scene graph elsewhere, to represent the occluder’s position in space; but until setOccluder() is called it will clip no geometry.

setP(other: NodePath, p: float) → None
setP(p: float) → None
setPos(pos: LVecBase3) → None

Sets the translation component of the transform, leaving rotation and scale untouched. This also resets the node’s “previous” position, so that the collision system will see the node as having suddenly appeared in the new position, without passing any points in between. See Also: NodePath.setFluidPos()

setPos(other: NodePath, pos: LVecBase3) → None

Sets the translation component of the transform, relative to the other node.

setPos(other: NodePath, x: float, y: float, z: float) → None

Sets the translation component of the transform, relative to the other node.

setPos(x: float, y: float, z: float) → None

Sets the translation component of the transform, leaving rotation and scale untouched. This also resets the node’s “previous” position, so that the collision system will see the node as having suddenly appeared in the new position, without passing any points in between.

setPosHpr(pos: LVecBase3, hpr: LVecBase3) → None

Sets the translation and rotation component of the transform, leaving scale untouched.

setPosHpr(other: NodePath, pos: LVecBase3, hpr: LVecBase3) → None

Sets the translation and rotation component of the transform, relative to the other node.

setPosHpr(other: NodePath, x: float, y: float, z: float, h: float, p: float, r: float) → None

Sets the translation and rotation component of the transform, relative to the other node.

setPosHpr(x: float, y: float, z: float, h: float, p: float, r: float) → None

Sets the translation and rotation component of the transform, leaving scale untouched.

setPosHprScale(pos: LVecBase3, hpr: LVecBase3, scale: LVecBase3) → None

Replaces the translation, rotation, and scale components, implicitly setting shear to 0.

setPosHprScale(other: NodePath, pos: LVecBase3, hpr: LVecBase3, scale: LVecBase3) → None

Completely replaces the transform with new translation, rotation, and scale components, relative to the other node, implicitly setting shear to 0.

setPosHprScale(other: NodePath, x: float, y: float, z: float, h: float, p: float, r: float, sx: float, sy: float, sz: float) → None

Completely replaces the transform with new translation, rotation, and scale components, relative to the other node.

setPosHprScale(x: float, y: float, z: float, h: float, p: float, r: float, sx: float, sy: float, sz: float) → None

Completely replaces the transform with new translation, rotation, and scale components.

setPosHprScaleShear(pos: LVecBase3, hpr: LVecBase3, scale: LVecBase3, shear: LVecBase3) → None

Completely replaces the transform with new translation, rotation, scale, and shear components.

setPosHprScaleShear(other: NodePath, pos: LVecBase3, hpr: LVecBase3, scale: LVecBase3, shear: LVecBase3) → None

Completely replaces the transform with new translation, rotation, scale, and shear components, relative to the other node.

setPosQuat(pos: LVecBase3, quat: LQuaternion) → None

Sets the translation and rotation component of the transform, leaving scale untouched.

setPosQuat(other: NodePath, pos: LVecBase3, quat: LQuaternion) → None

Sets the translation and rotation component of the transform, relative to the other node.

setPosQuatScale(pos: LVecBase3, quat: LQuaternion, scale: LVecBase3) → None

Replaces the translation, rotation, and scale components, implicitly setting shear to 0.

setPosQuatScale(other: NodePath, pos: LVecBase3, quat: LQuaternion, scale: LVecBase3) → None

Completely replaces the transform with new translation, rotation, and scale components, relative to the other node, implicitly setting shear to 0.

setPosQuatScaleShear(pos: LVecBase3, quat: LQuaternion, scale: LVecBase3, shear: LVecBase3) → None

Completely replaces the transform with new translation, rotation, scale, and shear components.

setPosQuatScaleShear(other: NodePath, pos: LVecBase3, quat: LQuaternion, scale: LVecBase3, shear: LVecBase3) → None

Completely replaces the transform with new translation, rotation, scale, and shear components, relative to the other node.

setPrevTransform(other: NodePath, transform: TransformState, current_thread: Thread) → None

Sets the “previous” transform object on this node, relative to the other node. This computes a new transform object that will have the indicated value when seen from the other node.

setPrevTransform(transform: TransformState, current_thread: Thread) → None

Sets the transform that represents this node’s “previous” position, one frame ago, for the purposes of detecting motion for accurate collision calculations.

setPythonTag(keys: object, value: object) → None
setQuat(quat: LQuaternion) → None

Sets the rotation component of the transform, leaving translation and scale untouched.

setQuat(other: NodePath, quat: LQuaternion) → None

Sets the rotation component of the transform, relative to the other node.

setQuatScale(quat: LQuaternion, scale: LVecBase3) → None

Sets the rotation and scale components of the transform, leaving translation untouched.

setQuatScale(other: NodePath, quat: LQuaternion, scale: LVecBase3) → None

Sets the rotation and scale components of the transform, leaving translation untouched. This, or set_pos_quat_scale, is the preferred way to update a transform when both quat and scale are to be changed.

setR(other: NodePath, r: float) → None
setR(r: float) → None
setRenderMode(mode: Mode, thickness: float, priority: int) → None

Sets up the geometry at this level and below (unless overridden) to render in the specified mode and with the indicated line and/or point thickness.

setRenderModeFilled(priority: int) → None

Sets up the geometry at this level and below (unless overridden) to render in filled (i.e. not wireframe) mode.

setRenderModeFilledWireframe(wireframe_color: LColor, priority: int) → None

Sets up the geometry at this level and below (unless overridden) to render in filled, but overlay the wireframe on top with a fixed color. This is useful for debug visualizations.

setRenderModePerspective(perspective: bool, priority: int) → None

Sets up the point geometry at this level and below to render as perspective sprites (that is, billboarded quads). The thickness, as specified with setRenderModeThickness(), is the width of each point in 3-D units, unless it is overridden on a per-vertex basis. This does not affect geometry other than points.

If you want the quads to be individually textured, you should also set a TexGenAttrib::M_point_sprite on the node.

setRenderModeThickness(thickness: float, priority: int) → None

Sets up the point geometry at this level and below to render as thick points (that is, billboarded quads). The thickness is in pixels, unless set_render_mode_perspective is also true, in which case it is in 3-D units.

If you want the quads to be individually textured, you should also set a TexGenAttrib::M_point_sprite on the node.

setRenderModeWireframe(priority: int) → None

Sets up the geometry at this level and below (unless overridden) to render in wireframe mode.

setSa(sa: float) → None

Sets the alpha scale component of the transform

setSb(sb: float) → None

Sets the blue scale component of the transform

setScale(scale: LVecBase3) → None

Sets the scale component of the transform, leaving translation and rotation untouched.

setScale(other: NodePath, scale: LVecBase3) → None

Sets the scale component of the transform, relative to the other node.

setScale(other: NodePath, scale: float) → None

Sets the scale component of the transform, relative to the other node.

setScale(other: NodePath, sx: float, sy: float, sz: float) → None

Sets the scale component of the transform, relative to the other node.

setScale(scale: float) → None

Sets the scale component of the transform, leaving translation and rotation untouched.

setScale(sx: float, sy: float, sz: float) → None
setScissor(a: LPoint3, b: LPoint3) → None

Sets up a scissor region on the nodes rendered at this level and below. The two points are understood to be relative to this node. When these points are projected into screen space, they define the diagonally-opposite points that determine the scissor region.

setScissor(a: LPoint3, b: LPoint3, c: LPoint3, d: LPoint3) → None

Sets up a scissor region on the nodes rendered at this level and below. The four points are understood to be relative to this node. When these points are projected into screen space, they define the bounding volume of the scissor region (the scissor region is the smallest onscreen rectangle that encloses all four points).

setScissor(other: NodePath, a: LPoint3, b: LPoint3) → None

Sets up a scissor region on the nodes rendered at this level and below. The two points are understood to be relative to the indicated other node. When these points are projected into screen space, they define the diagonally-opposite points that determine the scissor region.

setScissor(other: NodePath, a: LPoint3, b: LPoint3, c: LPoint3, d: LPoint3) → None

Sets up a scissor region on the nodes rendered at this level and below. The four points are understood to be relative to the indicated other node. When these points are projected into screen space, they define the bounding volume of the scissor region (the scissor region is the smallest onscreen rectangle that encloses all four points).

setScissor(left: float, right: float, bottom: float, top: float) → None

Sets up a scissor region on the nodes rendered at this level and below. The four coordinates are understood to define a rectangle in screen space. These numbers are relative to the current DisplayRegion, where (0,0) is the lower-left corner of the DisplayRegion, and (1,1) is the upper-right corner.

setSg(sg: float) → None

Sets the alpha scale component of the transform

setShader(sha: Shader, priority: int) → None
setShaderAuto(shader_switch: BitMask32, priority: int) → None

overloaded for auto shader customization

setShaderAuto(priority: int) → None
setShaderInput(id: InternalName, n1: float, n2: float, n3: float, n4: float, priority: int) → None
setShaderInput(param0: InternalName, param1: object, priority: int) → None
setShaderInput(id: InternalName, tex: Texture, sampler: SamplerState, priority: int) → None
setShaderInput(id: InternalName, tex: Texture, read: bool, write: bool, z: int, n: int, priority: int) → None
setShaderInput(id: InternalName, n1: int, n2: int, n3: int, n4: int, priority: int) → None
setShaderInput(input: ShaderInput) → None
setShaderInput(input: ShaderInput) → None
setShaderInputs(args: object, kwargs: object) → None
setShaderOff(priority: int) → None
setShear(shear: LVecBase3) → None

Sets the shear component of the transform, leaving translation and rotation untouched.

setShear(other: NodePath, shear: LVecBase3) → None

Sets the shear component of the transform, relative to the other node.

setShear(other: NodePath, shxy: float, shxz: float, shyz: float) → None

Sets the shear component of the transform, relative to the other node.

setShear(shxy: float, shxz: float, shyz: float) → None

Sets the shear component of the transform, leaving translation, rotation, and scale untouched.

setShxy(other: NodePath, shxy: float) → None
setShxy(shxy: float) → None
setShxz(other: NodePath, shxz: float) → None
setShxz(shxz: float) → None
setShyz(other: NodePath, shyz: float) → None
setShyz(shyz: float) → None
setSr(sr: float) → None

Sets the red scale component of the transform

setState(other: NodePath, state: RenderState, current_thread: Thread) → None

Sets the state object on this node, relative to the other node. This computes a new state object that will have the indicated value when seen from the other node.

setState(state: RenderState, current_thread: Thread) → None

Changes the complete state object on this node.

setSx(other: NodePath, sx: float) → None
setSx(sx: float) → None
setSy(other: NodePath, sy: float) → None
setSy(sy: float) → None
setSz(other: NodePath, sz: float) → None
setSz(sz: float) → None
setTag(key: str, value: str) → None

Associates a user-defined value with a user-defined key which is stored on the node. This value has no meaning to Panda; but it is stored indefinitely on the node until it is requested again.

Each unique key stores a different string value. There is no effective limit on the number of different keys that may be stored or on the length of any one key’s value.

setTexGen(stage: TextureStage, mode: TexGenMode, constant_value: LTexCoord3, priority: int) → None

Enables automatic texture coordinate generation for the indicated texture stage. This version of this method is useful when setting M_constant, which requires a constant texture coordinate value.

setTexGen(stage: TextureStage, mode: TexGenMode, priority: int) → None

Enables automatic texture coordinate generation for the indicated texture stage.

setTexHpr(other: NodePath, stage: TextureStage, hpr: LVecBase3) → None

Sets a texture matrix on the current node to apply the indicated rotation, as a 3-D HPR, to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexHpr(other: NodePath, stage: TextureStage, h: float, p: float, r: float) → None

Sets a texture matrix on the current node to apply the indicated rotation, as a 3-D HPR, to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexHpr(stage: TextureStage, hpr: LVecBase3) → None

Sets a texture matrix on the current node to apply the indicated rotation, as a 3-D HPR, to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexHpr(stage: TextureStage, h: float, p: float, r: float) → None

Sets a texture matrix on the current node to apply the indicated rotation, as a 3-D HPR, to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexOffset(other: NodePath, stage: TextureStage, uv: LVecBase2) → None

Sets a texture matrix on the current node to apply the indicated offset to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexOffset(other: NodePath, stage: TextureStage, u: float, v: float) → None

Sets a texture matrix on the current node to apply the indicated offset to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexOffset(stage: TextureStage, uv: LVecBase2) → None

Sets a texture matrix on the current node to apply the indicated offset to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexOffset(stage: TextureStage, u: float, v: float) → None

Sets a texture matrix on the current node to apply the indicated offset to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexPos(other: NodePath, stage: TextureStage, uvw: LVecBase3) → None

Sets a texture matrix on the current node to apply the indicated offset to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexPos(other: NodePath, stage: TextureStage, u: float, v: float, w: float) → None

Sets a texture matrix on the current node to apply the indicated offset to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexPos(stage: TextureStage, uvw: LVecBase3) → None

Sets a texture matrix on the current node to apply the indicated offset to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexPos(stage: TextureStage, u: float, v: float, w: float) → None

Sets a texture matrix on the current node to apply the indicated offset to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexProjector(stage: TextureStage, from: NodePath, to: NodePath, lens_index: int) → None

Establishes a TexProjectorEffect on this node, which can be used to establish projective texturing (but see also the NodePath.projectTexture() convenience function), or it can be used to bind this node’s texture transform to particular node’s position in space, allowing a LerpInterval (for instance) to adjust this node’s texture coordinates.

If to is a LensNode, then the fourth parameter, lens_index, can be provided to select a particular lens to apply. Otherwise lens_index is not used.

setTexRotate(other: NodePath, stage: TextureStage, r: float) → None

Sets a texture matrix on the current node to apply the indicated rotation, clockwise in degrees, to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexRotate(stage: TextureStage, r: float) → None

Sets a texture matrix on the current node to apply the indicated rotation, clockwise in degrees, to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexScale(other: NodePath, stage: TextureStage, scale: LVecBase2) → None

Sets a texture matrix on the current node to apply the indicated scale to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexScale(other: NodePath, stage: TextureStage, scale: LVecBase3) → None

Sets a texture matrix on the current node to apply the indicated scale to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexScale(other: NodePath, stage: TextureStage, scale: float) → None

Sets a texture matrix on the current node to apply the indicated scale to UV’s for the given stage.

This call is appropriate for 2-d or 3-d texture coordinates.

setTexScale(other: NodePath, stage: TextureStage, su: float, sv: float) → None

Sets a texture matrix on the current node to apply the indicated scale to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexScale(other: NodePath, stage: TextureStage, su: float, sv: float, sw: float) → None

Sets a texture matrix on the current node to apply the indicated scale to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexScale(stage: TextureStage, scale: LVecBase2) → None

Sets a texture matrix on the current node to apply the indicated scale to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexScale(stage: TextureStage, scale: LVecBase3) → None

Sets a texture matrix on the current node to apply the indicated scale to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexScale(stage: TextureStage, scale: float) → None

Sets a texture matrix on the current node to apply the indicated scale to UVW’s for the given stage.

This call is appropriate for 2-d or 3-d texture coordinates.

setTexScale(stage: TextureStage, su: float, sv: float) → None

Sets a texture matrix on the current node to apply the indicated scale to UV’s for the given stage.

This call is appropriate for ordinary 2-d texture coordinates.

setTexScale(stage: TextureStage, su: float, sv: float, sw: float) → None

Sets a texture matrix on the current node to apply the indicated scale to UVW’s for the given stage.

This call is appropriate for 3-d texture coordinates.

setTexTransform(other: NodePath, stage: TextureStage, transform: TransformState) → None

Sets the texture matrix on the current node to the indicated transform for the given stage.

setTexTransform(stage: TextureStage, transform: TransformState) → None

Sets the texture matrix on the current node to the indicated transform for the given stage.

setTexture(tex: Texture, sampler: SamplerState, priority: int) → None

Adds the indicated texture to the list of textures that will be rendered on the default texture stage.

The given sampler state will override the sampling settings on the texture itself. Note that this method makes a copy of the sampler settings that you give; further changes to this object will not be reflected.

This is the convenience single-texture variant of this method; it is now superceded by setTexture() that accepts a stage and texture. You may use this method if you just want to adjust the default stage.

setTexture(tex: Texture, priority: int) → None

Adds the indicated texture to the list of textures that will be rendered on the default texture stage.

This is the convenience single-texture variant of this method; it is now superceded by setTexture() that accepts a stage and texture. You may use this method if you just want to adjust the default stage.

setTexture(stage: TextureStage, tex: Texture, sampler: SamplerState, priority: int) → None

Adds the indicated texture to the list of textures that will be rendered on the indicated multitexture stage. If there are multiple texture stages specified (possibly on multiple different nodes at different levels), they will all be applied to geometry together, according to the stage specification set up in the TextureStage object.

The given sampler state will override the sampling settings on the texture itself. Note that this method makes a copy of the sampler settings that you give; further changes to this object will not be reflected.

setTexture(stage: TextureStage, tex: Texture, priority: int) → None

Adds the indicated texture to the list of textures that will be rendered on the indicated multitexture stage. If there are multiple texture stages specified (possibly on multiple different nodes at different levels), they will all be applied to geometry together, according to the stage specification set up in the TextureStage object.

setTextureOff(stage: TextureStage, priority: int) → None

Sets the geometry at this level and below to render using no texture, on the indicated stage. This is different from not specifying a texture; rather, this specifically contradicts setTexture() at a higher node level (or, with a priority, overrides a setTexture() at a lower level).

setTextureOff(priority: int) → None

Sets the geometry at this level and below to render using no texture, on any stage. This is different from not specifying a texture; rather, this specifically contradicts setTexture() at a higher node level (or, with a priority, overrides a setTexture() at a lower level).

setTransform(other: NodePath, transform: TransformState, current_thread: Thread) → None

Sets the transform object on this node, relative to the other node. This computes a new transform object that will have the indicated value when seen from the other node.

setTransform(transform: TransformState, current_thread: Thread) → None

Changes the complete transform object on this node.

setTransparency(mode: Mode, priority: int) → None

Specifically sets or disables transparent rendering mode on this particular node. If no other nodes override, this will cause items with a non-1 value for alpha color to be rendered partially transparent.

setTwoSided(two_sided: bool, priority: int) → None

Specifically sets or disables two-sided rendering mode on this particular node. If no other nodes override, this will cause backfacing polygons to be drawn (in two-sided mode, true) or culled (in one-sided mode, false).

setX(other: NodePath, x: float) → None
setX(x: float) → None
setY(other: NodePath, y: float) → None
setY(y: float) → None
setZ(other: NodePath, z: float) → None
setZ(z: float) → None
show() → None

Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgraph below this node) visible to all cameras.

This will not reveal the node if a parent node has been hidden.

show(camera_mask: DrawMask) → None

Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.

This undoes the effect of a previous hide() call. It will not reveal the node if a parent node has been hidden. However, see showThrough().

showBounds() → None

Causes the bounding volume of the bottom node and all of its descendants (that is, the bounding volume associated with the the bottom arc) to be rendered, if possible. The rendering method is less than optimal; this is intended primarily for debugging.

showThrough() → None

Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.

Unlike show(), this will reveal the node even if a parent node has been hidden, thus “showing through” a parent’s hide().

showThrough(camera_mask: DrawMask) → None

Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.

Unlike show(), this will reveal the node even if a parent node has been hidden via the one-parameter hide() method, thus “showing through” a parent’s hide(). (However, it will not show through a parent’s hide() call if the no-parameter form of hide() was used.)

showTightBounds() → None

Similar to showBounds(), this draws a bounding box representing the “tight” bounds of this node and all of its descendants. The bounding box is recomputed every frame by reexamining all of the vertices; this is far from efficient, but this is intended for debugging.

property sort

Returns the sort value of the referenced node within its parent; that is, the sort number passed on the last reparenting operation for this node. This will control the position of the node within its parent’s list of children.

Return type

int

stash(sort: int, current_thread: Thread) → None

Removes the referenced node (and the entire subgraph below this node) from the scene graph in any normal sense. The node will no longer be visible and is not tested for collisions; furthermore, no normal scene graph traversal will visit the node. The node’s bounding volume no longer contributes to its parent’s bounding volume.

A stashed node cannot be located by a normal find() operation (although a special find string can still retrieve it).

stashTo(other: NodePath, sort: int, current_thread: Thread) → None

Similar to reparentTo(), but the node is added to its new parent’s stashed list, so that the result is equivalent to calling reparentTo() immediately followed by stash().

property stashed_children

Returns the set of all child nodes of the referenced node that have been stashed. These children are not normally visible on the node, and do not appear in the list returned by getChildren().

Return type

NodePathCollection

property tags
unifyTextureStages(stage: TextureStage) → None

Searches through all TextureStages at this node and below. Any TextureStages that share the same name as the indicated TextureStage object are replaced with this object, thus ensuring that all geometry at this node and below with a particular TextureStage name is using the same TextureStage object.

unstash(sort: int, current_thread: Thread) → None

Undoes the effect of a previous stash() on this node: makes the referenced node (and the entire subgraph below this node) once again part of the scene graph.

unstashAll(current_thread: Thread) → None

Unstashes this node and all stashed child nodes.

verifyComplete(current_thread: Thread) → bool

Returns true if all of the nodes described in the NodePath are connected, or false otherwise.

writeBamFile(filename: Filename) → bool

Writes the contents of this node and below out to a bam file with the indicated filename. This file may then be read in again, as is, at some later point. Returns true if successful, false on some kind of error.

writeBamStream(out: ostream) → bool

Writes the contents of this node and below out to the indicated stream.

writeBounds(out: ostream) → None

Writes a description of the bounding volume containing the bottom node and all of its descendants to the indicated output stream.

wrtReparentTo(other: NodePath, sort: int, current_thread: Thread) → None

This functions identically to reparentTo(), except the transform on this node is also adjusted so that the node remains in the same place in world coordinates, even if it is reparented into a different coordinate system.