build_apps command uses pip to fetch any binary packages (including Panda3D) as wheels that are necessary to build the applications for other platforms. In order for pip to know which wheels to fetch(including the correct panda3d wheel), a requirements file (or a Pipfile if pipenv is being used) is required. After collecting dependencies, platform-specific binaries (e.g., exe on Windows) are built for each listed application for each listed platform.
The following options can be used with the
- the directory to build the applications in (defaults to "build" in the current working directory)
- a dictionary of applications that can open a window with executable names as keys and the path to the main/entry-point script as the value
- a dictionary of applications that do not open a window with executable names as keys and the path to the main/entry-point script as the value
- a list of patterns of files to include in the built applications
- a list of patterns of files to not include in the build application (takes precedence over include_patterns)
- a dictionary with keys being a path to match and the value being the path to replace it with
- a dictionary with keys being an application (use
'*' to denote all applications) and values being lists of Python modules to freeze into the application regardless of whether FreezeTool detects it as a dependency (useful for "hidden" imports that FreezeTool may not be able to follow)
- a dictionary with keys being an applications (use
'*' to denote all applications) and values being lists of Python modules to not freeze into the application regardless of whether FreezeTool detects it as a dependency
- a list of PEP 425 platform tags to build applications for (defaults to ['manylinux1_x86_64', 'macosx_10_6_x86_64', 'win_amd64'])
- a list of dynamically loaded Panda3D plugins include with the built applications (available plugins are listed below)
- a path to a requirements.txt file to use with PIP when fetching wheels (defaults to ./requirements.txt)
- if set, try to download optimized wheels using an extra index url (defaults to True)
- the extra index url to use to find optimized wheels (Panda3D will try to set a reasonable default if this is not set)
- a dictionary with keys matching extensions and values being functions of the form:
def func(build_cmd, srcpath, dstpath)
Default File Handlers
File handlers defined by the
option are added to a list of default file handlers. User-defined file handlers for an extension overrides the default file handler. The default file handlers are:
- run egg2bam
- adds support for additional audio, image, and video formats beyond what is built into Panda3D by default
- audio (including 3D audio) support using OpenAL
- audio (including 3D audio) support using FMOD
- adds support for additional model formats beyond BAM
- adds support for additional model formats beyond BAM by using Assimp
- software renderer
- OpenGL renderer
- OpenGL ES renderer
- OpenGL ES 2 renderer
- Direct 3D 9 renderer (Windows only)
More information about some of the libraries used by these plugins can be found here.
By default, Panda3D is built with extra debug information and code (sometimes referred to as an SDK build of Panda3D). While this extra debug information and code is very useful for developing a Panda3D application, it takes up more disk space and runs slower. To solve this, optimized wheels are available that strip out this debug information and code.
use_optimized_wheels is set to
build_app will automatically try to find an optimized wheel that meets the Panda3D version requirements of the application. It does this by exposing an extra index URL to pip. Optimized wheels are versioned such that they will have higher priority than regular wheels of the same version, but will have less priority than a newer version of a regular wheel.
If PyPI or archive.panda3d.org are used as the index for the regular Panda3D wheel, then
build_apps can pick an appropriate index URL for optimized wheels. Otherwise, set
optimized_wheel_index to point to the index that contains the optimized wheels.