[osg-users] Bug in 3.4.0 when exporting .osgx file?
Werner Modenbach
Werner.Modenbach at texion.eu
Tue Mar 21 07:54:19 PDT 2017
Hi Robert,
the problem is here:
if (osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED)
return findWrapper(name);
return NULL;
The loadLibrary() returns PREVIOUSLY_LOADED and not LOADED.
So NULL gets returned instead of a wrapper pointer and thus the node doesn't get exported.
Or am I on the wrong search path?
I try exporting my scene into an .osgx file by calling:
osg::ref_ptr<osgDB::ReaderWriter>rw=osgDB::Registry::instance()->getReaderWriterForExtension(
osgDB::getLowerCaseFileExtension(_filename.toStdString()));
if(!rw.valid()) returnfalse; osgDB::ReaderWriter::WriteResultresult=rw->writeNode(_node,_filename.toStdString());
result.success() is true.
It creates a file containing only the outer xml header and no scene data. node is of type osg::group
Am 21.03.2017 um 14:42 schrieb Robert Osfield:
> 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
>>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
*TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen*
Phone: +49 241 475757-0
Fax: +49 241 475757-29
Web: http://texion.eu
eMail: info at texion.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170321/4e51ce37/attachment-0003.htm>
More information about the osg-users
mailing list