Paul Martz wrote on 2009-12-14: > Jan Pečiva wrote: >>> 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! > > Oh, I thought you were saying that the alias doesn't get registered if > you set it from your app. > >> I am telling that this is NOT a good idea. And finally, the discussion >> about "design" ideas can start. > > I think it's a very good idea for a plugin to quickly reject a file if > the extension name is wrong. This is a matter of efficiency. The plugin > shouldn't waste time trying to read a file that it knows it doesn't > support. > > To support your usage, you should write a pseudoloader: a plugin that > accepts extension "ivx" (or whatever) but then turns around and invokes > the actual plugin to load the file. See osgdb_scale, osgdb_trans, etc.
When you add an alias, though, aren't you saying to the plugin, "Trust me, even though you don't recognize the file extension, handle it"? It would make sense, IMHO, for osgDB::Registry to add aliases to each plugin's list of handled extensions, and I don't think that would take too much work to do (make ReaderWriter::supportsExtension() public and call it in getReaderWriterForExtension() when it gets to the loaded library). -- Bryan Thrall FlightSafety International [email protected] _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

