Hi Felix,

The OSG is written so that it osg::Image are assumed to be valid and can be
applied to textures, so if the OSG isn't able to load a particular file it
returns NULL, or if you wish to capture the ReaderWriter::ReadResult you'll
get a FILE_NOT_FOUND.  If you want to modify this behaviour then you could
write a osgDB::Registry::ReadFileCallback that catches cases where the
readImage implementation fails to load anything and then could creates an
osg::Image with it's filename set to the problem file's name.

Robert.

On 12 November 2012 03:14, Felix Hu <[email protected]> wrote:

> I want to import an FBX model into osg, and I want osg to create an empty
> image if the referenced image file is not found or not supported by any
> plugin.
>
> I wrote some code like this:
>
>
> Code:
> auto node = osgDB::readNodeFile("model.fbx", new
> osgDB::Options("ForceReadingImage=true"));
>
>
>
>
> but this doesn't seem like to work, only valid images are loaded, no empty
> image created for thos not loaded.
>
> so, what is the correct way to use ForceReadingImage in this case ?
> is ForceReadingImage supported in any plugin other than osg2 ??
> is this option a global thing or only osg2 ?
> the document says "This is useful when converting from other formats.
> Image information won't be erased even without the external reference. "
>
> How can I realize this ?
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=51042#51042
>
>
>
>
>
> _______________________________________________
> 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