vash
May 10, 2012, 3:55pm
1
Hello !
I’m back with new VirtualFileSystem issue. I’ve upgraded to panda1.8 and a new problem appear with http and vfs.
Http can be mounted with a vfs as well and vfs.exists(“path/to/file”) return True but Filename() and Texture() doesn’t seems to locate files properly…
What have been the changes between 1.7.2 and 1.8 version of panda3d on http/vfs ?
Thanks
vash
drwr
May 10, 2012, 4:08pm
2
Can you give a simple example of a program that worked in 1.7.2 but doesn’t work in 1.8.0?
David
vash
May 11, 2012, 9:40am
3
Mmm ok I think, I understand a little bit more what’s going on.
It sounds like my previous issue mentionned in this post panda3d.org/forums/viewtopic … 3270#83270
It’s about PNMImage… again. So Texture and egg works well, but for PNMImage files can’t be found into a vfs without passing the exact path to the package. But in 1.7.2 it works for http mounted vfs… data are mounted into the start/ forlder (the actual root when panda3d is launched from the browser). So normally path should be good… but not in 1.8.0 for some reason ?!
vash
May 11, 2012, 4:14pm
4
Ok, it seems it’s not linked to that actually…
Here is a piece of code that worked before and doesn’t now :
from panda3d.core import Filename, VirtualFileSystem
from panda3d.core import PNMImage
vfs = VirtualFileSystem.getGlobalPtr()
vfs.mount(VirtualFileMountHTTP(myWebAdress), '/tmp', 0)
print "testing /tmp/world.png: " + str(vfs.exists("/tmp/world.png"))
print "testing /tmp/*/world.png: " + str(vfs.resolveFilename("world.png", "/tmp/"))
print "finding /tmp/*/world.png: " + str(vfs.findFile("world.png", "/tmp/"))
img = PNMImage()
img.read("/tmp/world.png")
print str(img)
and the output is :
testing /tmp/world.png: True
testing /tmp//world.png: True
finding /tmp/ /world.png: /tmp/world.png
(image: 0 by 0 pixels, 0 channels, 255 maxval., )
Vash
vash
June 5, 2012, 5:12pm
5
Ok I’m back with new tests :
So on http mounted files I’ve got :
print _vfs.getMounts() # -> [/, http://mydomain.com/tmp/], OK
print _vfs->getFile(filename) # -> /path/to/the/file.txt, OK
print _vfs->getFile(filename).openReadFile(autoUnwrap) # -> None
print _vfs->getFile(filename).getMount() # doesn't print anything !
I’ve looked at the source code of panda without finding nothing that should failed…