You are correct, it cannot find your myresources package, because you didn’t specify the URL that you will be hosting this package. As I said already in the other thread, you must specify this URL like this:
ok, I see, because in the Panda1.7 Game Developer Cookbook they put the resource package and the p3d together in the same .pdef, and they didn’t put the host :s so I thought that the p3d would find the ressource.
Anyway, I split this in 2 .def for package my resources and the other for my .p3d with the host file like this:
from panda3d.core import *
import sys
print sys.path
class pandagame(p3d):
require('panda3d')
require('myresources', host = 'file:///C:/Panda3D-1.7.2/samples/Test_pdef/test')
config(display_name='My_p3d_file')
mainModule('main', filename=Filename('Tut-Ball-in-Maze.py'))
This creates my .p3d, but when I run this file, I got a timeout connection:
:downloader: [02D46458] begin GET [ https://runtime.panda3d.org/contents.xml?1349458272 ]
:downloader: [02D46458] Timeout connecting to runtime.panda3d.org:443 for https://runtime.panda3d.org/contents.xml?1349458272.
Error getting URL https://runtime.panda3d.org/contents.xml?1349458272
It has to connect to the panda server, is that normal? Cuz I have problems with my proxy at work ( btw for the proxy do I need to put my credentials with the proxy in the config.prc file too? )
Thats weird, because, When I create a .p3d with a .pdef that doesn’t need other packages, it works and it doesnt try to connect to the panda server.
The file you name with the host parameter needs to be the directory that contains the contents.xml that you generated when you created the package. So, in your example you are asking Panda to look for the file c:\Panda3D-1.7.2\samples\Test_pdef\test\contents.xml. Is that the correct path to this file?
I think it is normal for it to contact panda3d.org; actually, I’m not sure why it doesn’t do this in every case.
You can put “http-proxy-username username:password” in your Config.prc file to supply your proxy login credentials. This doesn’t work for every proxy; it depends on the login mechanisms that your proxy supports.
Yes, it’s the correct path to contents.xml of myresources package, but I still having the same error in the log: Couldn’t find package myresources in contents file
Btw, at least that fixed my proxy problem, but there is another problem with my .pdef. I’m trying this with the panda sample Tut-Ball-in-Maze.py, so its works ok this file.
For create the package myresource I do:
from panda3d.core import *
import sys
print sys.path
class myresources(package):
file(Filename("models/*"))
And I call this with: ppackage -i test .pdef
There is something else that I’m forgetting?
(Sorry for all the questions, but its the first time with python and my project is in c++, so I didn’t even start with my things ):
I don’t see a problem with your package creation. Does the contents.xml file actually contain a reference to myresources?
You should probably also use the -f parameter to panda3d, to force it to re-read your latest contents.xml file (the default is to always read a previously-cached version if it is available).
“from panda3d.core import Lerp”? What is Lerp? Does this line work when you run it directly in Python? It doesn’t work for me. Edit: Ah, I see. Lerp is an old deprecated module; it was removed in Panda3D 1.8. Be sure you are using the ppackage tool that matches the version of Panda you wish to publish.
To include model files like models/square.bam, add require(‘models’) to your pdef file, or -r models if you use packp3d.
libp3ptloader.dll isn’t included in any package, I think. I don’t think it’s normally necessary.