[SOLVED] Why can multify not read files created by ppackage?

Hello all!

This is my first post and I come looking for help. Panda3D looks very promising and I’d really like to use it in a couple of my projects.

Unfortunately I’ve had a pretty rough start. I’ve spent three days reading documentation, looking at examples, trying to do stuff myself, failing, pulling my hair, trying again, failing - you get the picture. I’ve even tried reading the source code, but could not find the class I was looking for (where is the Multifile class defined?).

It’s been my experience that packaging can be difficult, so that’s were I started. My first goal was to try to package a barbones Panda3D application together with Qt/PySide. However, things started falling apart left and right and my problems are a lot more basic for now.
[size=150]
The problem[/size]
One of the things that did not work for me was reading multifiles I created with ppackage. Here’s a simple example:

# foobar.txt
baz

# simple.pdef
class simplemod(package):
    file("foobar.txt")

# in the same directory as simple.pdef
$ ppackage -i . ./simple.pdef
:AppRunner: Total Panda3D disk space used: 196 MB
:AppRunner: Configured max usage is: 2048 MB
:Packager: Reading ./simple.pdef
Generating simplemod/simplemod.mf
 
# the simplemod directory does not contain a file called simplemod.mf, but it has simplemod.mf.pz, which is probably a compressed version of the multifile?
$ multify -tvf simplemod/simplemod.mf.pz
Unable to open simplemod/simplemod.mf.pz for reading.

What’s going on? Why can’t multify read the file I just created?

[size=150]My system[/size]
I’m on Lubuntu 12.04 Precise Pangolin amd64.
panda3d runtime 1.0.4
ppackage says “This command will build p3d files that reference Panda3D cmu_1.8”

I’d really appreciate any help or insight :smiley:

Thank you!
rs2000

Hi, welcome to the community! :slight_smile: I’m sorry to hear that you’ve had so much trouble so far.

The .pz extension is a compression format. You can use the “punzip” utility to decompress a .mf.pz into a regular .mf, and “pzip” to do the opposite.

The Multifile class is defined in the C++ source, in panda/src/express/multifile.h. You probably don’t need to use it unless you want to manipulate multifiles from a program; if you simply want to access the data from your program, you can mount it using the virtual file system or if the .mf is part of a package, let the Panda3D runtime do that for you.

Using ppackage to create packages is a bit of an advanced topic for a newcomer, I’m afraid, and it may be easier for you to start with creating regular .p3d files (by inheriting your .pdef class from ‘p3d’ or by using the simpler packp3d utility instead). A .p3d file is also a type of multifile designed to hold a Panda3D application as opposed to external dependencies. However, I understand that you’re trying to package with an external C++ library, which does require the use of package trees if you want to maintain platform independence.

Good luck! We’d of course be happy to help you with any other issues that you might run into.

Thank you very much!

punzipping :smiley: the .mf.pz multifile made it readable for the multify command. I guess since ppackage obviously knows how to compress a multifile, I kind of expected multify to be able to uncompress it if necessary.

I just looked at the documentation again to see if it has some comment function (like PHP or Qt for example), but I could not find any. Does panda3d have user-contributed documentation?

I did start with packp3d, on Lubuntu 13.04 (raring) originally, using a package provided by the community. I could not run the .p3d file though because I could not find a package for the panda3d runtime for 13.04. Compiling the runtime myself failed and I switched to Windows pretty quickly.
On Windows, I tried packp3d, ppackage and even packpanda to package panda3d together with Qt. I don’t remember all that went wrong, but in many cases there were DLLs missing. I then figured that it might be easier for panda3d to find all dependencies on Linux, so I installed the latest LTS release for Lubuntu, which has official panda3d packages available (well, for Ubuntu really, but I did not see problems that seemed to be distribution-related so far).
On Lubuntu 12.04 I tried to package a simple hello world application with a panda window and a Qt label again, had problems again and finally gave up after not even being able to read a multifile I just created. That last problem is solved now, so I’ll try again :slight_smile:

Take a look at direct/src/p3d/thirdparty.pdef for examples of other packages.