ModelNode

from panda3d.core import ModelNode
class ModelNode

Bases:

Bases: PandaNode

This node is placed at key points within the scene graph to indicate the roots of “models”: subtrees that are conceptually to be treated as a single unit, like a car or a room, for instance. It doesn’t affect rendering or any other operations; it’s primarily useful as a high-level model indication.

ModelNodes are created in response to a <Model> { 1 } flag within an egg file.

Inheritance diagram

Inheritance diagram of ModelNode

enum PreserveTransform
enumerator PT_none = 0
enumerator PT_local = 1
enumerator PT_net = 2
enumerator PT_drop_node = 3
enumerator PT_no_touch = 4
__init__(name: str)
static get_class_type() TypeHandle
get_preserve_attributes() int

Returns the current setting of the preserve_attributes flag. See set_preserve_attributes().

get_preserve_transform() PreserveTransform

Returns the current setting of the preserve_transform flag. See set_preserve_transform().

set_preserve_attributes(attrib_mask: int)

Sets the preserve_attributes flag. This restricts the ability of a flatten operation to affect the render attributes stored on this node.

The value should be the union of bits from SceneGraphReducer::AttribTypes that represent the attributes that should not be changed.

set_preserve_transform(preserve_transform: PreserveTransform)

Sets the preserve_transform flag. This restricts the ability of a flatten operation to affect the transform stored on this node, and/or the node itself. In the order from weakest to strongest restrictions, the possible flags are:

PT_drop_node - This node should be removed at the next flatten call.

PT_none - The transform may be adjusted at will. The node itself will not be removed. This is the default.

PT_net - Preserve the net transform from the root, but it’s acceptable to modify the local transform stored on this particular node if necessary, so long as the net transform is not changed. This eliminates the need to drop an extra transform on the node above.

PT_local - The local (and net) transform should not be changed in any way. If necessary, an extra transform will be left on the node above to guarantee this. This is a stronger restriction than PT_net.

PT_no_touch - The local transform will not be changed, the node will not be removed, and furthermore any flatten operation will not continue below this node–this node and all descendents are protected from the effects of flatten.

set_transform_limit(limit: float)