panda3d/direct/src/p3d/panda3d.pdef
2009-10-12 19:35:54 +00:00

245 lines
7.9 KiB
Plaintext
Executable File

from pandac.PandaModules import Filename
# This file defines a number of standard "packages" that correspond to
# a Panda3D distribution. These packages are built by passing this
# file to the ppackage utility, either as a packaged application, or
# as the module direct.p3d.ppackage.
# The packages in this file define Panda3D itself. This is the third
# installed piece of the three-part plugin system (the plugin, the
# core API, Panda3D).
# When needed, these packages are downloaded by the core API, from the
# host URL specified in a given p3d file, and not from any hardcoded
# URL. Thus, any custom version of Panda3D may be hosted on any
# server in the world, and any version of the plugin can download it.
# Also see coreapi.pdef.
class panda3d(package):
# The main Panda3D package. Contains Python and most of the graphics
# code in Panda3D.
config(display_name = "Panda3D")
# First, add the minimum startup files for a Panda3D package.
# These are files that the Panda3D runtime will explicitly look
# for by name in order to get itself bootstrapped.
setupPanda3D()
# These are Python modules that are needed by most Panda3D
# applications. It doesn't matter too much if we miss one or two
# here, since any module imported by any of this code will
# automatically be included as well, and we end up with a pretty
# complete list that way.
module('direct.directbase.DirectStart',
# Don't want to include all files in direct.p3d, because
# that picks up the runtime scripts too, which are their
# own p3d files below.
'direct.p3d.AppRunner',
'direct.p3d.DWBPackageInstaller',
'direct.actor.*',
'direct.controls.*',
'direct.directdevices.*',
'direct.directnotify.*',
'direct.directtools.*',
'direct.directutil.*',
'direct.distributed.*',
'direct.fsm.*',
'direct.gui.*',
'direct.interval.*',
'direct.particles.*',
'direct.showbase.*',
'direct.showutil.*',
'direct.stdpy.*',
'direct.task.*')
# Exclude these Panda3D libs; they are big and many applications don't
# use them. We define them as separate, optional packages, below,
# except for skel - this is useless in a shipped game anyways.
excludeModule('libpandaegg')
excludeModule('libpandaode')
excludeModule('libpandaskel')
# Exclude these GUI toolkits; they're big, and many applications don't
# use them. We define them as separate, optional packages, below.
excludeModule('wx',
'direct.showbase.WxGlobal')
excludeModule('Tkinter',
'direct.showbase.TkGlobal',
'direct.tkpanels',
'direct.tkwidgets')
# Most of the core Panda3D DLL's will be included implicitly due to
# being referenced by the above Python code. Here we name a few more
# that are also needed, but aren't referenced by any code. Again,
# note that the .dll extension is automatically replaced with the
# platform-specific extension for an executable.
file('libpandagl.dll', 'libtinydisplay.dll')
if platform.startswith('win'):
file('libpandadx8.dll', 'libpandadx9.dll')
# A basic config file is needed to lay some some fundamental runtime
# variables.
if platform.startswith('win'):
auxDisplays = """
aux-display pandagl
aux-display pandadx9
aux-display pandadx8
aux-display tinydisplay
"""
else:
auxDisplays = """
aux-display pandagl
aux-display tinydisplay
"""
file('Config.prc', extract = True, text = """
plugin-path $PANDA3D_ROOT
default-model-extension .bam
""" + auxDisplays)
class fmod(package):
# This package includes the FMod audio library. This is
# full-featured and robust, but it is closed-source and the
# licensing is cost-free only for non-commercial products.
config(display_name = "FMod audio library")
require('panda3d')
file('libp3fmod_audio.dll')
file('fmod.prc', extract = True, text = """
plugin-path $FMOD_ROOT
audio-library-name p3fmod_audio
""")
class openal(package):
# This package includes the OpenAL audio libraries. This is free
# in both senses, but there are some technical issues, especially
# on certain platforms.
config(display_name = "OpenAL audio library")
require('panda3d')
file('libp3openal_audio.dll')
file('openal.prc', extract = True, text = """
plugin-path $OPENAL_ROOT
audio-library-name p3openal_audio
""")
class miles(package):
# This package includes the Miles Sound System audio library.
# This is closed-source and always requires a licensing fee.
config(display_name = "Miles Sound System")
require('panda3d')
file('libmiles_audio.dll')
if platform.startswith('win'):
file('mssmp3.asi', 'avcodec.dll', 'avutil.dll', 'avformat.dll',
executable = True)
elif platform.startswith('osx'):
file('libMilesMachO.dylib',
'libMilesMachOx86.dylib',
'mssmp3.asi', 'mssmixer.mix', 'Miles_MP3_Decoder.asi',
executable = True)
file('miles.prc', extract = True, text = """
plugin-path $MILES_ROOT
audio-library-name miles_audio
""")
class audio(package):
# This package includes the best audio library for the given
# platform, assuming a non-commercial application.
if platform.startswith('osx'):
require('fmod')
else:
require('openal')
class egg(package):
# This package contains the code for reading and operating on egg
# files. Since the Packager automatically converts egg files to bam
# files, this is not needed for most Panda3D applications.
config(display_name = "Panda3D egg loader")
require('panda3d')
file('libpandaegg.dll')
file('egg.prc', extract = True, text = """
plugin-path $EGG_ROOT
load-file-type egg pandaegg
""")
class ode(package):
# This package contains the code for the ODE integration.
# As not every application uses the ODE layers, and to cut down
# the download size, it is provided as separate package.
config(display_name = "Panda3D Open Dynamics Engine integration")
require('panda3d')
file('libpandaode.dll')
class wx(package):
config(display_name = "wxPython GUI Toolkit")
require('panda3d')
module('direct.showbase.WxGlobal', 'wx', 'wx.*')
class tk(package):
config(display_name = "Tk GUI Toolkit")
require('panda3d')
module('Tkinter',
'direct.showbase.TkGlobal',
'direct.tkpanels',
'direct.tkwidgets')
class packp3d(p3d):
# This application is a command-line convenience for building a p3d
# application out of a directory hierarchy on disk. We build it here
# into its own p3d application, to allow end-users to easily build p3d
# applications using the appropriate version of Python and Panda for
# the targeted runtime.
config(display_name = "Panda3D Application Packer",
hidden = True, platform_specific = False,
keep_user_env = True)
require('panda3d', 'egg')
mainModule('direct.p3d.packp3d')
class ppackage(p3d):
# As above, a packaging utility. This is the fully-general ppackage
# utility, which reads pdef files (like this one!) and creates one or
# more packages or p3d applications.
config(display_name = "Panda3D General Package Utility",
hidden = True, platform_specific = False,
keep_user_env = True)
require('panda3d', 'egg')
mainModule('direct.p3d.ppackage')
class ppatcher(p3d):
# A handy utility to go along with ppackage. This builds
# patchfiles as needed in the directory structure created by
# ppackage.
config(display_name = "Panda3D Patch Maker",
hidden = True, platform_specific = False,
keep_user_env = True)
require('panda3d')
mainModule('direct.p3d.ppatcher')