ModelRoot

from panda3d.core import ModelRoot
class ModelRoot

Bases: ModelNode

A node of this type is created automatically at the root of each model file that is loaded. It may eventually contain some information about the contents of the model; at the moment, it contains no special information, but can be used as a flag to indicate the presence of a loaded model file.

Inheritance diagram

Inheritance diagram of ModelRoot

class ModelReference

Bases: ReferenceCount

This class is used to unify references to the same model.

__init__(*args, **kwargs)
__init__(*args, **kwargs)
fullpath
getClassType()

C++ Interface: get_class_type()

getFullpath()

C++ Interface: get_fullpath(ModelRoot self)

/**
  • Returns the full pathname of the model represented by this node, as found

  • on disk. This is mainly useful for reference purposes, but is also used to

  • index the ModelRoot into the ModelPool.

*/

getModelRefCount()

C++ Interface: get_model_ref_count(ModelRoot self)

/**
  • Returns the number of copies that exist of this particular ModelRoot node.

  • Each time ModelRoot::copy_subgraph() or make_copy() is called (or some

  • other copying mechanism, such as NodePath.copy_to(), is used), this count

  • will increment by one in all copies; when one of the copies is destructed,

  • this count will decrement.

*/

getReference()

C++ Interface: get_reference(ModelRoot self)

/**
  • Returns the pointer that represents the object shared between all copies of

  • this ModelRoot. Since there’s not much associated with this object other

  • than a reference count, normally there’s not much reason to get the pointer

  • (though it may be compared pointerwise with other ModelRoot objects).

*/

getTimestamp()

C++ Interface: get_timestamp(ModelRoot self)

/**
  • Returns the timestamp of the file on disk that was read for this model, at

  • the time it was read, if it is known. Returns 0 if the timestamp is not

  • known or could not be provided. This can be used as a quick (but fallible)

  • check to verify whether the file might have changed since the model was

  • read.

*/

get_class_type()

C++ Interface: get_class_type()

get_fullpath()

C++ Interface: get_fullpath(ModelRoot self)

/**
  • Returns the full pathname of the model represented by this node, as found

  • on disk. This is mainly useful for reference purposes, but is also used to

  • index the ModelRoot into the ModelPool.

*/

get_model_ref_count()

C++ Interface: get_model_ref_count(ModelRoot self)

/**
  • Returns the number of copies that exist of this particular ModelRoot node.

  • Each time ModelRoot::copy_subgraph() or make_copy() is called (or some

  • other copying mechanism, such as NodePath.copy_to(), is used), this count

  • will increment by one in all copies; when one of the copies is destructed,

  • this count will decrement.

*/

get_reference()

C++ Interface: get_reference(ModelRoot self)

/**
  • Returns the pointer that represents the object shared between all copies of

  • this ModelRoot. Since there’s not much associated with this object other

  • than a reference count, normally there’s not much reason to get the pointer

  • (though it may be compared pointerwise with other ModelRoot objects).

*/

get_timestamp()

C++ Interface: get_timestamp(ModelRoot self)

/**
  • Returns the timestamp of the file on disk that was read for this model, at

  • the time it was read, if it is known. Returns 0 if the timestamp is not

  • known or could not be provided. This can be used as a quick (but fallible)

  • check to verify whether the file might have changed since the model was

  • read.

*/

loader_type
model_ref_count
reference
setFullpath()

C++ Interface: set_fullpath(const ModelRoot self, const Filename fullpath)

/**
  • Sets the full pathname of the model represented by this node, as found on

  • disk. This is mainly useful for reference purposes, but is also used to

  • index the ModelRoot into the ModelPool.

  • This is normally set automatically when a model is loaded, and should not

  • be set directly by the user. If you change this on a loaded model, then

  • ModelPool::release_model() may fail.

*/

setReference()

C++ Interface: set_reference(const ModelRoot self, ModelReference ref)

/**
  • Changes the pointer that represents the object shared between all copies of

  • this ModelRoot. This will disassociate this ModelRoot from all of its

  • copies. Normally, there’s no reason to do this.

*/

setTimestamp()

C++ Interface: set_timestamp(const ModelRoot self, int timestamp)

/**
  • Sets the timestamp of the file on disk that was read for this model. This

  • is normally set automatically when a model is loaded, and should not be set

  • directly by the user.

*/

set_fullpath()

C++ Interface: set_fullpath(const ModelRoot self, const Filename fullpath)

/**
  • Sets the full pathname of the model represented by this node, as found on

  • disk. This is mainly useful for reference purposes, but is also used to

  • index the ModelRoot into the ModelPool.

  • This is normally set automatically when a model is loaded, and should not

  • be set directly by the user. If you change this on a loaded model, then

  • ModelPool::release_model() may fail.

*/

set_reference()

C++ Interface: set_reference(const ModelRoot self, ModelReference ref)

/**
  • Changes the pointer that represents the object shared between all copies of

  • this ModelRoot. This will disassociate this ModelRoot from all of its

  • copies. Normally, there’s no reason to do this.

*/

set_timestamp()

C++ Interface: set_timestamp(const ModelRoot self, int timestamp)

/**
  • Sets the timestamp of the file on disk that was read for this model. This

  • is normally set automatically when a model is loaded, and should not be set

  • directly by the user.

*/

timestamp