> OSG plugin takes one look at the "foo" extension and returns an error.
> (This is correct behavior; the .osg plugin doesn't support the "foo" extension.)

This is exactly the point I am trying to point out! The plugin reports that it does not support the extension!

I am telling that this is NOT a good idea. And finally, the discussion about "design" ideas can start.

An user should be able to create alias that will work without changing OSG sources. Currently, the cow.foo file is simply refused by the plugin unless I open osgPlugin/osg/ReaderWriterOSG.cpp and put

 supportsExtension("foo","My new extension");

to the to the OSGReaderWriter constructor. This is a very bad idea. My logic is telling me that people want to create working aliases - not the ones that are refused by the plugins anyway. Ideas?

John


Paul Martz wrote:
Just to convince myself that this really does still work, I took an existing app and added the following code to the top of main():

    osgDB::Registry::instance()->addFileExtensionAlias( "foo", "osg" );
    osg::ref_ptr< osg::Node > testload(
            osgDB::readNodeFile( "cow.foo" ) );

Then I renamed cow.osg as cow.foo. Then I set a breakpoint in ReadFile.cpp at line 1683, and indeed the libraryName comes back as "osgdb_osgd.dll".

Turns out the file load fails anyway, as the OSG plugin takes one look at the "foo" extension and returns an error. (This is correct behavior; the .osg plugin doesn't support the "foo" extension.) But the alias does get registered and the appropriate plugin does get invoked.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466

_______________________________________________
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