How to change configuration variable in Panda3D program

Panda3D programs get their configuration parameters from a configuration file. One way to add or change a configuration variable used by a specific Panda3D program is by using the loadPrcFileData function call. It takes two parameters: the first one can be an empty string and specify the name-value string of the configuration variable in the second parameter.

For example, to use OpenGL for rendering Panda3D:

from panda3d.core import loadPrcFileData

loadPrcFileData( "", "load-display pandagl" )

Tried with: Panda3D 1.9 and Ubuntu 12.04 LTS


Configuration file of Panda3D

All Panda3D programs read their configuration options from a central configuration file: /etc/Config.prc

You can view this file to see what values are assigned to the various configuration variables that is used by any Panda3D program. A list of the possible configuration variables, their description and default values is here. With superuser permissions, this configuration file can be edited to change the parameters used by Panda3D programs.

Tried with: Panda3D 1.9 and Ubuntu 12.04 LTS

How to compress and uncompress files for Panda3D

Panda3D can load model files in formats like egg. However, text formats like egg can result in files of large size. Thankfully, Panda3D also supports loading model files if they are compressed.

The compression format that Panda3D supports is called pz. To compress and uncompress files into and out of this format, Panda3D ships with two programs: pzip and punzip.

To compress an egg file:

$ pzip foo.egg

To compress an egg file with maximum compression:

$ pzip -9 foo.egg

To uncompress a compressed egg file:

$ punzip foo.egg.pz

Tried with: Panda3D 1.9 and Ubuntu 12.04 LTS