Re: [osg-users] Regression in .zip loader?

2009-05-25 Thread Robert Osfield
Hi Ulrich,

On Sun, May 24, 2009 at 6:00 PM, Ulrich Hertlein u.hertl...@sandbox.de wrote:
 Hi all,

 have there been any recent changes in the .zip loader?  I just noticed that
 I can no longer load a bunch of zipped .x files.  OSG_NOTIFY_LEVEL=DEBUG
 shows that all plugins are found (.zip, .x, .bmp) but I still get 'No data
 loaded' from osgviewer.

 If I unpack the .zip file and load the .x directly everything is fine.

Arggh two steps forward, one back...

As Neil mentioned I'ved merged his changes to the zip plugin to allow
in memory unpacking, and it then use istreams to read the final modes,
and it looks like the .x plugin doesn't support reading from streams
yet.

There are lots of benefits with doing in memory unpacking of zip
files, such being able to read them from streams making it possible to
handle models zipped up and placed on http.  The ideal solution would
be to add streams support into .x plugin and any others that it's
missing for.

Another missing bit of the jigsaw is adding osgDB::Archive support
into the zip plugin so it can allow the model to be loaded and then
any other internally stored images to be loadable at the same time.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Regression in .zip loader?

2009-05-25 Thread Ulrich Hertlein

Hi Robert,

On 25/5/09 10:24 AM, Robert Osfield wrote:

On Sun, May 24, 2009 at 6:00 PM, Ulrich Hertleinu.hertl...@sandbox.de  wrote:

have there been any recent changes in the .zip loader?  I just noticed that
I can no longer load a bunch of zipped .x files.  OSG_NOTIFY_LEVEL=DEBUG
shows that all plugins are found (.zip, .x, .bmp) but I still get 'No data
loaded' from osgviewer.

If I unpack the .zip file and load the .x directly everything is fine.


Arggh two steps forward, one back...

As Neil mentioned I'ved merged his changes to the zip plugin to allow
in memory unpacking, and it then use istreams to read the final modes,
and it looks like the .x plugin doesn't support reading from streams
yet.

...
 handle models zipped up and placed on http.  The ideal solution would
 be to add streams support into .x plugin and any others that it's
 missing for.

I've added stream support to the .x plugin but the problem is deeper than that.

It seems like there's a serious bug in the zip loader.  If there are multiple files in the 
archive only the first one is read properly.  All the following ones are fed the same 
data.  So for example if you have a .zip that contains a .jpg and an .ive the JPEG is read 
properly but then the JPEG data is fed to the .ive plugin which of course doesn't work.


If the .ive is first then that is loaded and displayed but any following file is not read 
properly.


Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Regression in .zip loader?

2009-05-25 Thread neil.hughes
Hi Ulrich  Robert,

I've just done a cursory scan of the code again, and can't quite see what could 
be going wrong. However, I do note that the GetZipItem function can return an 
error state that the code isn't checking for. I'll try and have a look at it 
tomorrow, and set up a similar example for a 3ds node and a jpeg, and see 
what's happening there. However I would note in passing that I tested with a 
zip file that contained four 3ds models all zipped within the same file, and 
these worked file.

Ulrich, could you send me an example zip file that causes this issue please? If 
you could exclude .x as I don't regularly deal with this format. 
3ds/osg/ive/flt/jpg/tga would be fine if possible please. I could then 
investigate with a little more certainty that the example fails on your setup. 
Many thanks,

Neil.



 Ulrich Hertlein u.hertl...@sandbox.de wrote: 
 Hi Robert,
 
 On 25/5/09 10:24 AM, Robert Osfield wrote:
  On Sun, May 24, 2009 at 6:00 PM, Ulrich Hertleinu.hertl...@sandbox.de  
  wrote:
  have there been any recent changes in the .zip loader?  I just noticed that
  I can no longer load a bunch of zipped .x files.  OSG_NOTIFY_LEVEL=DEBUG
  shows that all plugins are found (.zip, .x, .bmp) but I still get 'No data
  loaded' from osgviewer.
 
  If I unpack the .zip file and load the .x directly everything is fine.
 
  Arggh two steps forward, one back...
 
  As Neil mentioned I'ved merged his changes to the zip plugin to allow
  in memory unpacking, and it then use istreams to read the final modes,
  and it looks like the .x plugin doesn't support reading from streams
  yet.
  ...
   handle models zipped up and placed on http.  The ideal solution would
   be to add streams support into .x plugin and any others that it's
   missing for.
 
 I've added stream support to the .x plugin but the problem is deeper than 
 that.
 
 It seems like there's a serious bug in the zip loader.  If there are multiple 
 files in the 
 archive only the first one is read properly.  All the following ones are fed 
 the same 
 data.  So for example if you have a .zip that contains a .jpg and an .ive the 
 JPEG is read 
 properly but then the JPEG data is fed to the .ive plugin which of course 
 doesn't work.
 
 If the .ive is first then that is loaded and displayed but any following file 
 is not read 
 properly.
 
 Cheers,
 /ulrich
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Regression in .zip loader?

2009-05-24 Thread Ulrich Hertlein

Hi all,

have there been any recent changes in the .zip loader?  I just noticed that I can no 
longer load a bunch of zipped .x files.  OSG_NOTIFY_LEVEL=DEBUG shows that all plugins are 
found (.zip, .x, .bmp) but I still get 'No data loaded' from osgviewer.


If I unpack the .zip file and load the .x directly everything is fine.

Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Regression in .zip loader?

2009-05-24 Thread neil.hughes
Hi Ulrich,

If you've taken the recent trunk checkins, then the answer is yes, there have 
been some recent changes to the .zip loader. However, I had hoped that there 
would be no downsides to the amendments made. Essentially, where as previously 
the expansion of the .zip file was performed to the local filing system - ie 
your hard disk - now the unpacking process is all done in memory.

There were some issues in getting the modification to compile on unix boxes, 
but I believe Robert solved that, and another maillist member made a 
modification to get it to compile on Mac's. So I thought it was all working.

One issue that may now arise, and something that Robert and I are pondering, is 
where a model references a texture contained within the same zip file. At the 
moment, using the in-memory unpacking, this is not supported. Essentially we 
need to figure out how to use the .zip as an archive that can be interrogated 
for files during a model load operation. Hopefully Robert or I will have 
something on this in the near future. 

Until then...you could rename the original_readnode function in the .zip plugin 
to replace the new readnode (this would put you back to unpacking to the local 
file system). I understand that Robert is offline for a few days with a nasty 
cold/flu, but when he's back, we could look to make an amendment to provide an 
options switch to control which unpacking method is used. I may submit this 
anyway, and leave it to Robert to decide on acceptance.

Hope the info helps, and sorry for any inconvenience that the amendment may 
have caused.

Kind regards

Neil.


 Ulrich Hertlein u.hertl...@sandbox.de wrote: 
 Hi all,
 
 have there been any recent changes in the .zip loader?  I just noticed that I 
 can no 
 longer load a bunch of zipped .x files.  OSG_NOTIFY_LEVEL=DEBUG shows that 
 all plugins are 
 found (.zip, .x, .bmp) but I still get 'No data loaded' from osgviewer.
 
 If I unpack the .zip file and load the .x directly everything is fine.
 
 Cheers,
 /ulrich
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org