ConfigVariable

from panda3d.core import ConfigVariable
class ConfigVariable

Bases:

Bases: ConfigVariableBase

This is a generic, untyped ConfigVariable. It is also the base class for the typed ConfigVariables, and contains all of the code common to ConfigVariables of all types (except ConfigVariableList, which is a bit of a special case).

Mostly, this class serves as a thin wrapper around ConfigVariableCore and/or ConfigDeclaration, more or less duplicating the interface presented there.

Inheritance diagram

Inheritance diagram of ConfigVariable

__init__(param0: ConfigVariable)
__init__(name: str)

Use this constructor to make a ConfigVariable of an unspecified type. Usually you’d want to do this just to reference a previously-defined ConfigVariable of a specific type, without having to know what type it is.

__reduce__() object
clear_value()

Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through.

get_num_words() int

Returns the number of words in the variable’s value. A word is defined as a sequence of non-whitespace characters delimited by whitespace.

get_string_value() str

Returns the toplevel value of the variable, formatted as a string.

set_string_value(value: str)

Changes the value assigned to this variable. This creates a local value that shadows any values defined in the .prc files, until clear_local_value() is called.