Hi Dario,

On 25/08/10 4:26 , Dario Minieri wrote:
> Now, I've a strange behaviour. In the viewer ALL WORKS FINE, I can see the 
> models
> switch and all relatives textures correctly. The written LOD model is correct 
> in terms
> of meshes (I see the correct models transition when the bound is reached) but 
> there is
> a very strange problem with the textures (assuming to use 2 models):
> 
> 1. If I DON'T switch between near and middle object in the viewer, then the 
> LOD model
> written have NO TEXTURE for the NEAR object, but have the CORRECT texture for 
> the
> second model!
> 
> 2. If I SWITCH between near and middle object in the viewer, then I see NO 
> TEXTURE for
> all LOD objects models.
> 
> I've tried to disable the my_viewer->setSceneData(LOD_model_pointer) (and the
> Fl::redraw() idle action), so that I can't view the models loaded in the 
> viewer. In
> this case, the LOD written model is correct!!! There are all textures!!! I've 
> tried
> also writing the LOD model without using the graphical application (this is 
> rougly the
> same test...) and, obviously, all works fine!!!
> 
> So, seems that if an object is visualized under the viewer, then the 
> writeObject method
> don't writes the textures informations, otherwise is ok. In effects, the near 
> model is
> ever showed as first and so don't ever has the textures. The viewer "locks" 
> the texture
> informations...?!? This is very strange for me...

Are you saving '.ive' files with inlined textures by any chance?

Once a texture is applied/used its associated image data by default is removed 
from memory
to save space.  This means that the image *data* cannot be saved to disk 
anymore (but the
file name can).

You can prevent this by calling 'setUnRefImageDataAfterApply(false)' on the 
textures.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to