<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Robert,<br>
    <br>
    the problem is here:<br>
    <pre wrap="">if (osgDB::Registry::instance()->loadLibrary(pluginLib)==osgDB::Registry::LOADED)</pre>
        return findWrapper(name);
    <pre wrap="">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:
<span style=" color:#800080;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">osg</span>::<span style=" color:#800080;">ref_ptr</span><<span style=" color:#800080;">osgDB</span>::<span style=" color:#800080;">ReaderWriter</span>><span style=" color:#c0c0c0;"> </span>rw<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">osgDB</span>::<span style=" color:#800080;">Registry</span>::instance()->getReaderWriterForExtension(
<span style=" color:#c0c0c0;">                                        </span><span style=" color:#800080;">osgDB</span>::getLowerCaseFileExtension(_filename.toStdString()));
<span style=" color:#c0c0c0;">    </span><span style=" color:#808000;">if</span><span style=" color:#c0c0c0;"> </span>(!rw.valid())
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">return</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">false</span>;
    osgDB</span>::<span style=" color:#800080;">ReaderWriter</span>::<span style=" color:#800080;">WriteResult</span><span style=" color:#c0c0c0;"> </span>result<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>rw-><span style=" font-style:italic; color:#000000;">writeNode</span>(_node,<span style=" color:#c0c0c0;"> </span>_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
</pre>
    <br>
    <div class="moz-cite-prefix">Am 21.03.2017 um 14:42 schrieb Robert
      Osfield:<br>
    </div>
    <blockquote
cite="mid:CAFN7Y+Wh9TEF__dw1aUF3EQvoHKDnXk2qkN2LdUL6yBJwYKn4A@mail.gmail.com"
      type="cite">
      <pre wrap="">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 <a class="moz-txt-link-rfc2396E" href="mailto:Werner.Modenbach@texion.eu"><Werner.Modenbach@texion.eu></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">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
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>

</pre>
      </blockquote>
      <pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <b>TE<span style="color:red;">X</span>ION Software Solutions,
        Rotter Bruch 26a, D-52068 Aachen</b><br>
      Phone: +49 241 475757-0<br>
      Fax: +49 241 475757-29<br>
      Web: <a class="moz-txt-link-freetext" href="http://texion.eu">http://texion.eu</a><br>
      eMail: <a class="moz-txt-link-abbreviated" href="mailto:info@texion.eu">info@texion.eu</a><br>
    </div>
  </body>
</html>