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:
  wglGraphicsPipe
  wdxGraphicsPipe9
  wdxGraphicsPipe8
  TinyWinGraphicsPipe
  TinyOffscreenGraphicsPipe
(all display modules loaded.)
:display:windisplay: OS version: 6.1.2.7600
:display:windisplay:
: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?

David

Yes, if I run

ppython script.py
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 main.py script?

if __name__ == '__main__':

If so: main is not “main” in your packaged script, but “main” (the name of the module, “main.py”).
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 direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import Sequence
from panda3d.core import Point3

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

    self.environ = self.loader.loadModel("environment")
    self.environ.reparentTo(self.render)
    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)
    self.pandaActor.reparentTo(self.render)
    self.pandaActor.loop('walk')

    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,
        pandaHprInterval1,
        pandaPosInterval2,
        pandaHprInterval2,
        name='pandaPace')
    self.pandaPace.loop()


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

app = MyApp()
app.run()

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?

David

Okey.
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!