Okay for vegetables then! But just a few (silly?) questions:
How do I call the appropriate write method? Just using a default 
WriteFileCallback or similar? If not, can I ensure the osgDB::Options is 
correctly passed? And finally, how will I handle differences (ex: images must 
be "8.3" in 3DS, potatoes can't be in a subdirectory for ".vegetable" format, 
etc.?)

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- "Robert Osfield" <[email protected]> a écrit :

> Hi Sukender,
> 
> On Thu, Apr 21, 2011 at 4:05 PM, Sukender <[email protected]> wrote:
> > First of all: agreed to make it work for all (images, shaders,
> potatoes...)
> 
> Perhaps we should generalize to supporting vegtables rather thean
> specifically potatoes ;-)
> 
> I think it should be relatively straight forward to handling
> osg::Object's and let the class call the appropriate osgDB::write
> method.
> 
> 
> 
> > About features:
> >>  1) Enable writing out of images only once
> >>  2) Handling of paths that are absolute or relative.
> >>  3) Handles directory creation when paths don't just exist
> >
> > Additionnal feature:
> >  2.1) Also get the absolute path where it was written, as well as
> the path relative to the "main file" (= the 3D model)
> >  2.2) Also generate writing paths which may keep original directory
> structure ("_keepRelativePaths" member).
> >     Ex: Reading model.osg, which has "images/img1.jpg".
> >         Writing "/somePath/newmodel.osg" and
> "/somePath/images/img1.jpg"
> >         Of course, with the option disabled, this may write
> "/somePath/img1.jpg"
> >  4) Duplicate handling: avoid writing two different images (or
> "things") at the same place.
> 
> So this would be renaming when the same filename is requested but the
> actual Object being passed
> in isn't the same?
> 
> > What should also be added:
> >  5) Handling of naming constraints (such as "8.3" names in 3DS)
> >
> >
> > About "caching" values, yes that's true FOR NOW the write() comes
> just after. So, I agree to merge setCurImage() and write()
> ("writeImage()", then?). But this also makes getCurAbsolutePath() and
> getCurRelativeOrAbsolutePath() return paths where image was written.
> So maybe the writeImage() should return a pair of strings (or fill a
> structure)?
> 
> This type of state data associated with an operation should probably
> be passed into the write method via a reference or passed back as a
> result, these two approaches would avoid state being stored.
> 
> 
> > And finally, what about "WriterHelper" or "ExternalFileWriter"?
> 
> ExternalFileWriter would probably be my current preference, although
> I
> am sure we could find a better name.  Can't think of a better one
> right now... Perhaps others can chip in.
> 
> Robert.
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to