[osg-users] writeNodeFile with texture infomation

Han Hu huhan8807 at gmail.com
Sun Sep 18 00:43:54 PDT 2016


I have figured out a solution. The steps are as the following, the core file for the solution lies in OutputStream::writeImage function.

1. To write a image (e.g., *.jpg) inside a file, we need the WRITE_INLINE_FILE mode, which is set by 

Code:

osgDB::Options options;
options.setOptionString("WriteImageHint=IncludeFile");
osgDB::writeNodeFile(*node, "out.osgb", &options);




2. The image has to be first write to disk and a proper search path is needed. A node visitor will do the image write correctly and the search path is set by

Code:
osgDB::setDataFilePathList(lists);



Cheers,
Han

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








More information about the osg-users mailing list