Hi Paul, The extension is only used by osgDB::Registry when no pre-existing plugin is able to load that file format as it uses the "Chain of Responsibility" Design Pattern with the plugins. The mechanism basically calls each registered (already loaded in memory) plugin with all read/write calls, leaving it up to the plugins whether they can handle it or not. This enables a single plugin to handle multiple file formats, or potentially as in your case multiple file formats with the same extension - all you require in this case is for the plugins to properly check the file type. Only if no plugins can handle the read/file attempt does th Registry then attempt to load a new plugin from disk based on the extension name.
In your case you'd preload the Polytrans based plugin and let it handle all the file types it can. Robert. On Fri, Jun 12, 2009 at 5:54 PM, Paul Martz<[email protected]> wrote: > Hi Robert -- > > Correct me if I'm wrong, but right now OSG doesn't support multiple > different file formats that just happen to share the same extension. For > example, if three different developers came up with three plugins to load > certain information, and all just happened to use extension "abc" for their > file names, then the standard OSG interface for loading files wouldn't be > able to gracefully support all three file formats. The app would need to > explicitly load the plugins for each format, and then things should work > well. Is my understanding correct? > > I'm creating some new plugins and would like to "reserve" the extension to > avoid any conflicts with other development. In particular, the extensions I > intend to use are: > .osgb > .skeleton > .skel > > Seems like we need some kind of extension registry; the downside of this is > that it is only useful if people use it. > > Alternatively, I wonder how much effort it would be to enhance the osgDB so > that it can handle different file formats that share the same extension? > PolyTrans, for example, identifies a plugin through not only the extension, > but also a descriptive string that it queries from the DLL after load. > > Another way to do this would be to modify osgDB so that if the read fails > with an error in reading file, the osgDB goes and searches for another > plugin to support the extension. > > Thoughts? > -- > > Paul Martz > Skew Matrix Software LLC > 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

