Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to change configuration variable in Panda3D program

📅 2013-Mar-04 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

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