panda3d.core.PandaSystem

from panda3d.core import PandaSystem
class PandaSystem

This class is used as a namespace to group several global properties of Panda. Application developers can use this class to query the runtime version or capabilities of the current Panda environment.

Inheritance diagram

Inheritance diagram of PandaSystem

static getVersionString() → str

Returns the current version of Panda, expressed as a string, e.g. “1.0.0”. The string will end in the letter “c” if this build does not represent an official version.

static getPackageVersionString() → str

Returns the version of the Panda3D distributable package that provides this build of Panda.

When the currently-executing version of Panda was loaded from a distributable package, such as via the browser plugin, then this string will be nonempty and will contain the corresponding version string. You can build applications that use this particular version of Panda by requesting it in the pdef file, using “panda3d”, this version string, and the download host provided by getPackageHostUrl().

If this string is empty, then the currently-executing Panda was built independently, and is not part of a distributable package.

This string is set explicitly at compilation time. Normally, it should be set to a nonempty string only when building a Panda3D package for distribution.

static getPackageHostUrl() → str

Returns the URL of the download server that provides the Panda3D distributable package currently running. This can be used, along with the getPackageVersionString(), to uniquely identify the running version of Panda among distributable Panda versions.

See getPackageVersionString() for more information.

This string is set explicitly at compilation time. Normally, it should be set to a nonempty string only when building a Panda3D package for distribution.

static getP3dCoreapiVersionString() → str

Returns the current version of Panda’s Core API, expressed as a string of dot-delimited integers. There are usually four integers in this version, but this is not guaranteed.

The Core API is used during the runtime (plugin) environment only. This may be the empty string if the current version of Panda is not built to provide a particular Core API, which will be the normal case in a development SDK. However, you should not use this method to determine whether you are running in a runtime environment or not.

static getMajorVersion() → int

Returns the major version number of the current version of Panda. This is the first number of the dotted triple returned by getVersionString(). It changes very rarely.

static getMinorVersion() → int

Returns the minor version number of the current version of Panda. This is the second number of the dotted triple returned by getVersionString(). It changes with each release that introduces new features.

static getSequenceVersion() → int

Returns the sequence version number of the current version of Panda. This is the third number of the dotted triple returned by getVersionString(). It changes with bugfix updates and very minor feature updates.

static isOfficialVersion() → bool

Returns true if current version of Panda claims to be an “official” version, that is, one that was compiled by an official distributor of Panda using a specific version of the panda source tree. If this is true, there will not be a “c” at the end of the version string returned by getVersionString().

Note that we must take the distributor’s word for it here.

static getMemoryAlignment() → int

Returns the memory alignment that Panda’s allocators are using.

static getDistributor() → str

Returns the string defined by the distributor of this version of Panda, or “homebuilt” if this version was built directly from the sources by the end- user. This is a completely arbitrary string.

static getCompiler() → str

Returns a string representing the compiler that was used to generate this version of Panda, if it is available, or “unknown” if it is not.

static getBuildDate() → str

Returns a string representing the date and time at which this version of Panda (or at least dtool) was compiled, if available.

static getGitCommit() → str

Returns a string representing the git commit hash that this source tree is based on, or the empty string if it has not been specified at build time.

static getPlatform() → str

Returns a string representing the runtime platform that we are currently running on. This will be something like “win32” or “osx_i386” or “linux_amd64”.

hasSystem(system: str) → bool

Returns true if the current version of Panda claims to have the indicated subsystem installed, false otherwise. The set of available subsystems is implementation defined.

getNumSystems() → size_t

Returns the number of Panda subsystems that have registered themselves. This can be used with getSystem() to iterate through the entire list of available Panda subsystems.

Return type

size_t

getSystem(n: size_t) → str

Returns the nth Panda subsystem that has registered itself. This list will be sorted in alphabetical order.

getSystemTag(system: str, tag: str) → str

Returns the value associated with the indicated tag for the given system. This provides a standard way to query each subsystem’s advertised capabilities. The set of tags and values are per-system and implementation-defined.

The return value is the empty string if the indicated system is undefined or if does not define the indicated tag.

addSystem(system: str) → None

Intended for use by each subsystem to register itself at startup.

setSystemTag(system: str, tag: str, value: str) → None

Intended for use by each subsystem to register its set of capabilities at startup.

heapTrim(pad: size_t) → bool

Attempts to release memory back to the system, if possible. The pad argument is the minimum amount of unused memory to keep in the heap (against future allocations). Any memory above that may be released to the system, reducing the memory size of this process. There is no guarantee that any memory may be released.

Returns true if any memory was actually released, false otherwise.

output(out: ostream) → None
write(out: ostream) → None
static getGlobalPtr() → PandaSystem

Returns the global PandaSystem object.

Return type

PandaSystem

static getClassType() → TypeHandle
Return type

TypeHandle

getSystems() → list
property version_string

Returns the current version of Panda, expressed as a string, e.g. “1.0.0”. The string will end in the letter “c” if this build does not represent an official version.

Return type

string

property major_version

Returns the major version number of the current version of Panda. This is the first number of the dotted triple returned by getVersionString(). It changes very rarely.

Return type

int

property minor_version

Returns the minor version number of the current version of Panda. This is the second number of the dotted triple returned by getVersionString(). It changes with each release that introduces new features.

Return type

int

property sequence_version

Returns the sequence version number of the current version of Panda. This is the third number of the dotted triple returned by getVersionString(). It changes with bugfix updates and very minor feature updates.

Return type

int

property official_version

Returns true if current version of Panda claims to be an “official” version, that is, one that was compiled by an official distributor of Panda using a specific version of the panda source tree. If this is true, there will not be a “c” at the end of the version string returned by getVersionString().

Note that we must take the distributor’s word for it here.

Return type

bool

property memory_alignment

Returns the memory alignment that Panda’s allocators are using.

Return type

int

property distributor

Returns the string defined by the distributor of this version of Panda, or “homebuilt” if this version was built directly from the sources by the end- user. This is a completely arbitrary string.

Return type

string

property compiler

Returns a string representing the compiler that was used to generate this version of Panda, if it is available, or “unknown” if it is not.

Return type

string

property build_date

Returns a string representing the date and time at which this version of Panda (or at least dtool) was compiled, if available.

Return type

string

property git_commit

Returns a string representing the git commit hash that this source tree is based on, or the empty string if it has not been specified at build time.

Return type

string

property platform

Returns a string representing the runtime platform that we are currently running on. This will be something like “win32” or “osx_i386” or “linux_amd64”.

Return type

string

property systems

Returns the nth Panda subsystem that has registered itself. This list will be sorted in alphabetical order.

Return type

Sequence[string]