packp3d Problem

I run a game >ppython main.py
and it runs but I get errors (sounds like prior post Posted: Thu Aug 25, 2011 7:26 am Post subject: issue with gsg reference count?)

after closing the game the command window shows

C:\game>ppython main.py
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(error): c:\buildslave\release_sdk_win32\build\panda3d\panda\s
rc\glstuff\glGraphicsBuffer_src.cxx, line 1020: GL error 1282
:display:gsg:glgsg(error): c:\buildslave\release_sdk_win32\build\panda3d\panda\s
rc\glstuff\glGraphicsBuffer_src.cxx, line 1020: GL error 1282
:display:gsg:glgsg(error): c:\buildslave\release_sdk_win32\build\panda3d\panda\s
rc\glstuff\glGraphicsBuffer_src.cxx, line 1020: GL error 1282
:display:gsg:glgsg(error): c:\buildslave\release_sdk_win32\build\panda3d\panda\s
rc\glstuff\glGraphicsBuffer_src.cxx, line 1020: GL error 1282
:display:gsg:glgsg(error): c:\buildslave\release_sdk_win32\build\panda3d\panda\s
rc\glstuff\glGraphicsBuffer_src.cxx, line 1020: GL error 1282

Then when I try to packp3d the game packp3d dies with the following:

C:\web>packp3d -o test.p3d -d C:\game
:AppRunner: Total Panda3D disk space used: 120 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 415, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 473, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\Ap
pRunner.py”, line 745, in __startIfReady
File “VFSImporter”, line 153, in load_module
File “direct\p3d\packp3d.py”, line 219, in
makePackedApp(sys.argv[1:])
File “direct\p3d\packp3d.py”, line 209, in makePackedApp
packager.endPackage()
File “direct\p3d\Packager.py”, line 2705, in endPackage
if not package.close():
File “direct\p3d\Packager.py”, line 437, in close
result = self.installMultifile()
File “direct\p3d\Packager.py”, line 539, in installMultifile
self.freezer.done()
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 860, in done
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 950, in __loadModule
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 1402, in load_module
File “c:\python26\lib\modulefinder.py”, line 305, in load_module
File “c:\python26\lib\modulefinder.py”, line 414, in scan_code
File “c:\python26\lib\modulefinder.py”, line 323, in _safe_import_hook
File “c:\python26\lib\modulefinder.py”, line 125, in import_hook
File “c:\python26\lib\modulefinder.py”, line 162, in determine_parent
KeyError: ‘Models’
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\Ap
pRunner.py”, line 636, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\T
ask.py”, line 502, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\T
ask.py”, line 460, in step
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 415, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showba
se\Messenger.py”, line 473, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\Ap
pRunner.py”, line 745, in __startIfReady
File “VFSImporter”, line 153, in load_module
File “direct\p3d\packp3d.py”, line 219, in
makePackedApp(sys.argv[1:])
File “direct\p3d\packp3d.py”, line 209, in makePackedApp
packager.endPackage()
File “direct\p3d\Packager.py”, line 2705, in endPackage
if not package.close():
File “direct\p3d\Packager.py”, line 437, in close
result = self.installMultifile()
File “direct\p3d\Packager.py”, line 539, in installMultifile
self.freezer.done()
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 860, in done
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 950, in __loadModule
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showut
il\FreezeTool.py”, line 1402, in load_module
File “c:\python26\lib\modulefinder.py”, line 305, in load_module
File “c:\python26\lib\modulefinder.py”, line 414, in scan_code
File “c:\python26\lib\modulefinder.py”, line 323, in _safe_import_hook
File “c:\python26\lib\modulefinder.py”, line 125, in import_hook
File “c:\python26\lib\modulefinder.py”, line 162, in determine_parent
KeyError: ‘Models’
Failure on startup.

Pack3d worked on Roaming Ralph sample program.

Are the two issues related?

These two issues are not related. The first one is largely an ignorable warning.

The second issue is a known issue with packp3d, and is probably due to your having one or more .py files within a subdirectory that does not also contain a init.py file. This confuses packp3d.

David

Does moving the modules up to the top directory fix it?

That should also fix it.

I am not getting any log in user/…
is there a setup issue or something I need to do?
packp3d does give me the following

:stuck_out_tongue:ackager(warning): No such file: /c/game-1.7.2-2/game2/p3d_info.xml

What do you mean “not getting any log”? Have you found the Panda3D directory? If you’ve found it, does it contain a “log” subdirectory? If it does, does it contain any files?

David

I have files in a directory C:\Panda3D-1.7.2
and C:\Program Files (x86)\Panda3D

I can run the program with >python main.py but when I >packp3d -o test.p3d and click on test.p3d the window opens then dies with no errors I can see.

I can not find a log folder.

From the pasckp3d messages all I see for errors is
:stuck_out_tongue:ackager(warning): No such file: /c/game-1.7.2-2/game/p3d_info.xml

I am guessing you are on Windows, so when you execute p3d your runtime directory will be something like c:\Users[your_username]\AppData\Local\Panda3D\

There you can find log directory and check files inside it.

Also, when you pack your application you have to explicitly name some of the non-standard file extensions (so *.py files will be packaged by default, but *.xml files will not). Use -n xml switch when you package your app.

Sorry no such directory? David, can you shed any light on why the game runs using >python main.py and not using packp3d? It occurs to me that all the parameters, restrictions (eg. no py files in sub directories, no .egg files in loads, etc.) indicate the packp3d program is not as well written as python.
Is it an evolving program?

A p3d file is a very different environment then a development Python environment. These things that are different are different by design, to allow the magic things that p3d files can do: you can give a p3d file to another user and it is entirely self-contained, including all your code and models; and he can run the same file on Linux, Mac, or Windows; and you can even embed it on a web page and run it in a web environment, even in a “secure” environment such as IE provides in UAC mode.

These differences have some impact on your code structure, though, and it does mean it’s possible to write a program that runs in the development Python environment but doesn’t run in the p3d file. This doesn’t mean that something’s broken in the p3d system, it just means that you haven’t followed the strict rules precisely, and you need to figure out what it is that your program’s doing that’s not the right way to do it in the p3d file.

But you haven’t told us what your program’s doing that’s not working, so there is no way we can help you figure out what’s wrong.

You also haven’t found the log directory yet. I assure you it exists. It’s not in C:\Panda3D-1.7.2 or in C:\Program Files (x86)\Panda3D ; there’s another directory called Panda3D, which is in the directory c:\Users[your_username]\AppData\Local\Panda3D, as ognjenk described. This directory must exist or you wouldn’t be able to run packp3d at all. Since you say you can run packp3d, it follows that the AppData\Local\Panda3D folder really does exist. It might be a hidden folder, though; Windows likes to hide the AppData\Local folder from naive users. Type it in anyway.

David

OK, it was hidden.
Error is

from pandac.PandaModules import EggData, Point3
not importing Eggdata

You need to use the -r egg switch in packp3d command line to include EggData as per this manual page:

panda3d.org/manual/index.php … g_packages

Entered
C:\game>packp3d -o test.p3d -r ai -r openal -r morepy -r egg 2> test.txt

log p3dsession CAN NOT LOAD EnergyBar.Egg

File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Loader.py”, line 169, in loadModel
IOError: Could not load model file(s): [‘EnergyBar.egg’]
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py”, line 636, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py”, line 502, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py”, line 460, in step
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py”, line 415, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py”, line 473, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py”, line 745, in __startIfReady
File “VFSImporter”, line 153, in load_module

Seems that if you are using an egg file with packp3d, finding the egg file or any png files for a model are difficult to locate. Does the config.prc file need some change or setup to locate the models in a sub directory, or does everything need to be in the app file?

So per the manual,
If you want to keep some of your egg files as they are, without converting them to bam files, you must use the more advanced ppackage utility to create your p3d file.

Do I need to use ppackaqge to use an egg file?

Egg files are automatically converted to bam files as part of the packp3d process (bam files are about 1/10 the size of the equivalent egg files, so you almost never really want to ship egg files).

To load a model in code for pack3d, simply don’t specify the extension. Use loader.loadModel(‘EnergyBar’) instead of loader.loadModel(‘EnergyBar.egg’). The Python runtime will understand you to mean ‘EnergyBar.egg’, while the p3d runtime will understand you to mean ‘EnergyBar.bam’.

David

Almost complete, I am getting an audio error and a common filter error. For audio messages I tried adding -r audio to packp3d and changed config.prc to these two lines
load-display pandagl
aux-display pandadx9

Error log shows following on execiting the p3d file
:AppRunner: Total Panda3D disk space used: 277 MB
:AppRunner: Configured max usage is: 2048 MB
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)
AL lib: dsound.c:85: Failed to load dsound.dll
:movies(error): Could not open audio/sfx/GUI_rollover.wav
:audio(error): Cannot open file: audio/sfx/GUI_rollover.wav
:audio(error): Could not open audio audio/sfx/GUI_rollover.wav
:movies(error): Could not open audio/sfx/GUI_click.wav
:audio(error): Cannot open file: audio/sfx/GUI_click.wav
:audio(error): Could not open audio audio/sfx/GUI_click.wav
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py”, line 415, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py”, line 473, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py”, line 745, in __startIfReady
File “VFSImporter”, line 153, in load_module
File “C:\Game-1.7.2-2\game\main.py”, line 3, in
w = World()
File “C:\Game-1.7.2-2\game\WorldClass.py”, line 56, in init
self.filters = CommonFilters(base.win, base.cam)
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\filter\CommonFilters.py”, line 51, in init
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\filter\FilterManager.py”, line 57, in init
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\directnotify\Notifier.py”, line 132, in error
StandardError: Could not find appropriate DisplayRegion to filter
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py”, line 636, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py”, line 502, in run
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py”, line 460, in step
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py”, line 415, in __taskChainDispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py”, line 473, in __dispatch
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py”, line 745, in __startIfReady
File “VFSImporter”, line 153, in load_module
File “C:\Game-1.7.2-2\game\main.py”, line 3, in
w = World()
File “C:\Game-1.7.2-2\game\WorldClass.py”, line 56, in init
self.filters = CommonFilters(base.win, base.cam)
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\filter\CommonFilters.py”, line 51, in init
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\filter\FilterManager.py”, line 57, in init
File “C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\directnotify\Notifier.py”, line 132, in error
StandardError: Could not find appropriate DisplayRegion to filter
:TaskManager: TaskManager.destroy()
Failure on startup.

Try using -r fmod instead of -r audio for now. I think the 1.7.2 version of the Panda3D runtime didn’t provide a good OpenAL for Windows.

David

That seems to fix the audio issue.

Any ideas on the filters problem. Can packp3d load a bam file as in model.bam ? As in textures added to an egg model to get a combined bam?

I don’t know what’s going on with the CommonFilters error, but the error message implies that base.cam was not open on a DisplayRegion of base.win. I don’t know why that would be so. Perhaps you created the CommonFilters before the window had been opened? I haven’t experimented with putting this in a p3d file.

This doesn’t have anything to do with loading a bam file or its textures, which works fine.

David