I recently had similar issues.  There are multiple ways to store textures in
the model.  You can convert your model to .osg format and look to see how
the textures are stored in your model.  And/or have your code try all the
possibilities until you no longer get NULL.

Jason






-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Julian
Looser
Sent: Sunday, November 01, 2009 1:16 PM
To: [email protected]
Subject: [osg-users] Textures and Images

Hi,

I have a question about osg::Textures. In my program I load an IVE file with
embedded textures. Once it is loaded, I traverse the subgraph with a custom
visitor which inspects each osg::StateSet. I find osg::Textures within these
statesets, and I want to get the filenames for the images the textures are
using.

I thought I had this working as a bunch of test models loaded and were
analysed correctly. However, for some models, the textures are found, but if
I call getImage(n) on the texture, NULL is returned. The texture looks fine
in the viewer, so I know the image data has been loaded at some point.

Shouldn't an osg::Texture loaded from an image file always have a valid
osg::Image you can access?

Why would this work for some models and not others? Is it a difference in
the loaders for different image formats?

Cheers,
Julian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18997#18997





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to