Instead of loading and applying textures to our models in the game, we're going to create a new Panda3D application that we'll call a bam writer. This application will load up our models and texture them, then save out a bam file that will retain all the work we've done. Then, we'll just need to load the bams into the game. While we're at it, we'll set up the bam writer to give us a good preview of the models to make sure they look nice.
Open a blank document in Notepad++. Save the file as
BamWriter_01.py
.Our first step is to import all the components we'll need for this application. Add this code to the new file:
import direct.directbase.DirectStart from pandac.PandaModules import * from InputManagerClass_00 import InputManager
Next, we'll create a new class to perform the work of the bam writer, and put some code in its
__init
__ method to get the ball rolling:class BamWriter: def __init__(self): base.setBackgroundColor(0, 0, 0) base.disableMouse...