Blank white screen after packaging

I am using 1.7.0 SDK, and Windows 7 64 bit.

I am packaging with packp3d.exe, the tutorial panda application from the manual. (I copied the models to the project directory).

When I double click on the generated “p3d” file I get a blank-white window. If i run it from command line the output is as follows:

:display: loading display module: libpandagl.dll
:display: loading display module: libpandadx9.dll
:display: loading display module: libpandadx8.dll
:display: loading display module: libtinydisplay.dll
Known pipe types:
(all display modules loaded.)
:display:windisplay: OS version:
:display:windisplay: max Mhz 2403000000, current Mhz 2403000000
:ShowBase: Default graphics pipe is wglGraphicsPipe (OpenGL).
:display: Unable to set window properties: !undecorated
:ShowBase: Successfully opened window of type wglGraphicsWindow (OpenGL)
:audio: NullAudioManager
:audio: NullAudioManager
:ShowBase: __dev__ == 0
:loader: Reading /mf/environment.bam
:loader: Reading /mf/panda-model.bam
:loader: Reading /mf/panda-walk4.bam
:ShowBase: Got window event: origin=(-1, -1) size=(640, 480) title="Panda" !unde
corated !fullscreen foreground !minimized open !cursor_hidden absolute
:ShowBase: Got window event: origin=(-1, -1) size=(640, 480) title="Panda" !unde
corated !fullscreen !foreground !minimized open !cursor_hidden absolute

PS: I tried vertex-buffers #f (found it somewhere on forums) - does nothing.

Does it run correctly if you run it interactively?


Yes, if I run

it works!

I am wandering if it’s using the wrong python for the generating of a package or something related to python version.

Are you using this line in your script?

if __name__ == '__main__':

If so: main is not “main” in your packaged script, but “main” (the name of the module, “”).
Removing the “if” or changing this line like bleow should fix it then:

if __name__ in ['__main__', 'main']:

That makes as much sense as removing the ‘if’, because name is always one of those two (correct me if I’m wrong).

Nope, I don’t use main. Here is my script:

from direct.showbase.ShowBase import ShowBase
from math import pi, sin, cos
from direct.task import Task
from import Actor
from direct.interval.IntervalGlobal import Sequence
from panda3d.core import Point3

class MyApp(ShowBase):
  def __init__(self):

    self.environ = self.loader.loadModel("environment")
    self.environ.setScale(0.25, 0.25, 0.25)
    self.environ.setPos(-8, 42, 0)

    self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")

    self.pandaActor = Actor("panda-model",
        {'walk' : 'panda-walk4'})
    self.pandaActor.setScale(0.005, 0.005, 0.005)

    pandaPosInterval1 = self.pandaActor.posInterval(13,
        Point3(0, -10, 0),
        startPos = Point3(0, 10, 0))
    pandaPosInterval2 = self.pandaActor.posInterval(13,
        Point3(0, 10, 0),
        startPos = Point3(0, -10, 0))
    pandaHprInterval1 = self.pandaActor.hprInterval(3,
        Point3(180, 0, 0),
        startHpr = Point3(0,0,0))
    pandaHprInterval2 = self.pandaActor.hprInterval(3,
        Point3(0, 0, 0),
        startHpr=Point3(180, 0, 0))
    self.pandaPace = Sequence(pandaPosInterval1,

  def spinCameraTask(self, task):
    angle = task.time * 6.0
    radians = angle * (pi/180.0) * sin(radians), -20.0*cos(radians), 3), 0,0)
    return Task.cont

app = MyApp()

Umm… right. My fault. Either it is ‘main’ if called directly by the interpreter, or ‘main’ if it is imported by some other script. So the line I suggested is useless, and removing the line is the right thing. But seems this is not the problem.

Hm. What happens if you import DirectStart, instead of ShowBase, and don’t inherit from ShowBase?


I think I figured it out.
I copied the models but I didn’t copy the textures, so I got a bunch of errors which I thought were part of the build process:

:gobj(error): Unable to find texture "maps/envir-treetrunk.jpg" on model-path /d

In any case - i think it’s weird that running it from command line works (it finds the sample models and textures just fine) - but it does not work when packaging.

Thanks in any case!