OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Does FBX (or any other) plugin supports ForceReadingImage ?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
WalkingCat
Newbie


Joined: 01 Nov 2012
Posts: 10

PostPosted: Mon Nov 12, 2012 3:14 am    Post subject:
Does FBX (or any other) plugin supports ForceReadingImage ?
Reply with quote

I want to import an FBX model into osg, and I want osg to create an empty image if the referenced image file is not found or not supported by any plugin.

I wrote some code like this:

Code:
auto node = osgDB::readNodeFile("model.fbx", new osgDB::Options("ForceReadingImage=true"));


but this doesn't seem like to work, only valid images are loaded, no empty image created for thos not loaded.

so, what is the correct way to use ForceReadingImage in this case ?
is ForceReadingImage supported in any plugin other than osg2 ??
is this option a global thing or only osg2 ?
the document says "This is useful when converting from other formats. Image information won't be erased even without the external reference. "

How can I realize this ?
Back to top
View user's profile Send private message
WalkingCat
Newbie


Joined: 01 Nov 2012
Posts: 10

PostPosted: Wed Dec 05, 2012 7:10 pm    Post subject:
Does FBX (or any other) plugin supports ForceReadingImage ?
Reply with quote

I want to import an FBX model into osg, and I want osg to create an empty image if the referenced image file is not found or not supported by any plugin.

I wrote some code like this:


Code:
auto node = osgDB::readNodeFile("model.fbx", new osgDB::Options("ForceReadingImage=true"));




but this doesn't seem like to work, only valid images are loaded, no empty image created for thos not loaded.

so, what is the correct way to use ForceReadingImage in this case ?
is ForceReadingImage supported in any plugin other than osg2 ??
is this option a global thing or only osg2 ?
the document says "This is useful when converting from other formats. Image information won't be erased even without the external reference. "

How can I realize this ?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51042#51042







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12144

PostPosted: Wed Dec 12, 2012 9:35 am    Post subject:
Does FBX (or any other) plugin supports ForceReadingImage ?
Reply with quote

Hi Felix,

The OSG is written so that it osg::Image are assumed to be valid and can be applied to textures, so if the OSG isn't able to load a particular file it returns NULL, or if you wish to capture the ReaderWriter::ReadResult you'll get a FILE_NOT_FOUND.  If you want to modify this behaviour then you could write a osgDB::Registry::ReadFileCallback that catches cases where the readImage implementation fails to load anything and then could creates an osg::Image with it's filename set to the problem file's name.

Robert.

On 12 November 2012 03:14, Felix Hu < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I want to import an FBX model into osg, and I want osg to create an empty image if the referenced image file is not found or not supported by any plugin.

I wrote some code like this:


Code:
auto node = osgDB::readNodeFile("model.fbx", new osgDB::Options("ForceReadingImage=true"));




but this doesn't seem like to work, only valid images are loaded, no empty image created for thos not loaded.

so, what is the correct way to use ForceReadingImage in this case ?
is ForceReadingImage supported in any plugin other than osg2 ??
is this option a global thing or only osg2 ?
the document says "This is useful when converting from other formats. Image information won't be erased even without the external reference. "

How can I realize this ?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51042#51042





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Could not find plugin to load objects sdef General [3rdparty] 0 Sat Oct 27, 2018 6:10 am View latest post
No new posts osg3.6.3 plugin issues jaisingla Plugins [osgPlugins] 2 Thu Oct 18, 2018 6:35 am View latest post
No new posts building the fbx plugin Tare Plugins [osgPlugins] 2 Wed Oct 10, 2018 3:04 pm View latest post
No new posts TIFF plugin reader does not handle im... Eric Sokolowsky Submission 0 Sat Sep 29, 2018 2:30 am View latest post
No new posts decent font without free type plugin OmegaDoom General 0 Mon Jun 25, 2018 12:12 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP