Hi John,

Extension alias certainly does work - it's used all the time by osgDB,
go look inside src/osgDB/Registry.cpp to see lots of examples of it in
action.  What is happening at your end I can't guess, I don't have
your code.

Robert.

On Mon, Dec 14, 2009 at 2:08 PM, Jan Pečiva <[email protected]> wrote:
> Robert,
> thanks for the comment, however it does not work. Do I need to extend/patch
> OSG?
>
> An investigation showed that many plugins check once again in readNode
> method whether the extension is accepted. At this moment, ivx is refused. I
> am not sure, but the explicit alias that user makes should be stronger than
> what plugin thinks about itself. Reasons: Sometimes, software developers
> just decide to change file extension while the format stays the same. The
> application for interiors design may want to use "int" extension while file
> format is still osg, or whatever. I think, OSG should allow to do that.
>
> Ideas?
>
> I suggest to change
>
>   bool ReaderWriter::acceptsExtension(const std::string& extension) const;
>
> to accept even the extensions added by:
>
>   osgDB::Registry::instance()->addFileExtensionAlias(from,to);
>
> Comments?
>
> Thx,
> John
>
>
> Robert Osfield wrote:
>>
>> Hi John,
>>
>> On Mon, Dec 14, 2009 at 1:17 PM, Jan Pečiva <[email protected]> wrote:
>>
>>>
>>> Question: Is is possible to register the ivx alias?
>>>
>>
>> You have two options, to preload your plugin so it gets tried before
>> any other plugin so can intercept and handle all .iv file reads, or to
>> use an osgDB::Registry file extension alias.  The later is probably
>> the neatest solution can be done via:
>>
>>   osgDB::Registry::instance()->addFileExtensionAlias("iv","ivx");
>>
>> Robert.
>> _______________________________________________
>> 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
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to