Hi all,
I have been searching for a way to use Panda3D on my Macbook Pro running Mac OS X 10.5 Leopard and found one today. This method should work, I guess, on 10.4 if you install Python 2.4 as noted in the last part. I am new to Panda3D and was simply looking to experiment. Since there is not a lot of information about getting things to work under OS X I thought I would post how I did it.
All credit for the hard work it took to actually get things working by patching and compiling must go to Hypnos (and others?). All I did was move things to where it was easy to run the samples on my system.
The end result of all this is an install of Panda3D that is available for general system use (or to your user, depending on where you put the frameworks).
Hypnos’ thread on his OS X application bundle is below for reference. If you’re going to distribute a Panda3D application, you should probably stick with the bundle he’s made. My method is more for learning and easily running tutorials.
discourse.panda3d.org/viewtopic.php … highlight=
First, download p3dapp from here (I got 0.7):
public.nouser.org/~rspoerri/Deve … ts/p3dapp/
Open that DMG file, revealing the p3dapp application bundle. Right click or Ctrl click and select ‘Show Package Contents’ from the menu. Open another finder window and select ‘Go To Folder…’ from the ‘Go’ menu. Type in ‘/usr/local’ without the quotes and click Go. If you get ‘the folder cannot be found’, open the Terminal and create it with ‘sudo mkdir /usr/local’.
Back in the package contents window, navigate into the Content folder, then into the Resources folder. Copy the opt folder and the panda folder into /usr/local (you probably will be prompted for your password). Now, in the package window navigate back one directory and then into the Frameworks directory. In your other finder window go to either ~/Library/Frameworks or /Library/Frameworks (the first will make Panda available to your user and you may have to create the directory; the second will make it available to all users on your system. I went with the first.) Copy Cg.framework and OpenAL.framework to the Frameworks directory you chose.
Now add this to your .bash_profile:
# Add Panda3d path and dev variables
if [ -d "/usr/local/panda/bin" ]
then
export PATH="/usr/local/panda/bin:$PATH"
export PYTHONPATH=/usr/local/panda/lib:/usr/local/panda/lib/direct
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}/usr/local/panda/lib:/usr/local/opt/lib
fi
And finally, if you want openal audio, edit /usr/local/panda/etc/60_config.prc. Comment out the fmod_audio line and uncomment the openal audio line above it. Close your Terminal and restart it so the new environment variables take effect.
Grab the ‘complete source code’ tar.gz file and decompress it. Open the Terminal once more and navigate to the samples directory in the newly decompressed source directory. Run a sample by going in one directory and executing ‘python Tut-xxx.py’
You will get warnings about a Python C API version mismatch if you are using 10.5’s Python 2.5. So far I have ignored them and things have worked well enough to run all the samples I have tried. The only thing I’ve run into so far is a few samples (fireflies) report that the video driver doesn’t support multiple render targets. Maybe someone with more Panda3D experience can sort that out.
Also, the C API warnings can become overwhelming, so you might want to play with Python’s warning control switch. You can use something like:
python -W ignore::RuntimeWarning Tut-xxx.py
The full blown description of Python warnings is here and in the python man page.
docs.python.org/lib/module-warnings.html
If you’re on 10.4 or want to try Python 2.4 on 10.5 (don’t recommend this), there are universal packages of 2.4 here:
pythonmac.org/packages/py24-fat/index.html
Hope this helps someone else get started today with Panda3D!