[osg-users] Bug in 3.4.0 when exporting .osgx file?

Robert Osfield robert.osfield at gmail.com
Tue Mar 21 06:42:44 PDT 2017


Hi Werner,

I can't work out what might be wrong form the description.

In general the ObjectWrapperManager::findWrapper() checks wrappers
that have been registered with it first, then if it fails to find one
then attempts to load plugins that may be able to provide that
wrapper. If the code is getting to the find return then it's an
indication that the wrapper has been found.  Given this the
ObjectWrapperManager::findWrapper() code looks correct.

This review would suggest that the issue is likely elsewhere.  What
might be wrong is not something I can say at this stage.  Would it be
possible create a test case that reproduces the problem so others can
look into it?

Robert.


On 21 March 2017 at 13:15, Werner Modenbach <Werner.Modenbach at texion.eu> wrote:
> Hi Robert,
>
> I think I catched another problem in version 3.4.0.
> I try exporting my scene as .osgx file.
> But except the xml header nothing is written.
> I debuged it and found the following sequence of calls:
>
>
>         osg::ref_ptr<osgDB::ReaderWriter> rw =
> osgDB::Registry::instance()->getReaderWriterForExtension(
>
>
> osgDB::getLowerCaseFileExtension(_filename.toStdString()));
>
>     if (!rw.valid())
>
>         return false;
>
>     osgDB::ReaderWriter::WriteResult result = rw->writeNode(_node,
> _filename.toStdString());
>
> -> ReaderWriterOSG2::writeNode(...)
>
>     result = writeNode( node, fout, local_opt.get() );
>
> -> ReaderWriterOSG2::writeNode(...)
>
>         os.writeObject( &node ); CATCH_EXCEPTION(os);
>
> -> OutputStream::writeObject(...)
>
>     if (newID)
>     {
>         writeObjectFields(obj);
>     }
>
> -> OutputStream::writeObjectFields(...)
>
>     ObjectWrapper* wrapper =
> Registry::instance()->getObjectWrapperManager()->findWrapper( name );
>     if ( !wrapper )
>     {
>         OSG_WARN << "OutputStream::writeObject(): Unsupported wrapper class
> "
>                                 << name << std::endl;
>         return;
>     }
>
> -> OutputStream::writeObjectFields(...)
>
>     ObjectWrapper* wrapper =
> Registry::instance()->getObjectWrapperManager()->findWrapper( name );
>     if ( !wrapper )
>     {
>         OSG_WARN << "OutputStream::writeObject(): Unsupported wrapper class
> "
>                                 << name << std::endl;
>         return;
>     }
> -> ObjectWrapperManager::findWrapper(...)
>
>         pluginLib =
> osgDB::Registry::instance()->createLibraryNameForExtension(libName);
>         if (
> osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED
> )
>             return findWrapper(name);
>     }
>     return NULL;
>
> The loadLibrary(...) method returns "PREVIOUSLY_LOADED" and so NULL is
> returned and nothing gets written.
>
> I think that should be different. Am I right?
>
> - Werner -
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list