Hi Danny,
however I beleive that this problem happens beause of line 545
in operator()
filename<< _filename<< "_"<< context_id;
it will add context_id even if SetPolicy is set as OVERWRITE .
I beleive this is bug. Isn't it?
Ah, so the incrementing number was not indicating increasing numbers of
images but increasing numbers of contexts. I can explain this, it is not
a bug.
In this case, the WriteFile class was designed to do something sensible
in all cases. In the case where your View has multiple slave cameras
with multiple graphics contexts, then one screen capture will need to
capture multiple contexts therefore have multiple osg::Images to write
to file. You wouldn't want them to be written to the same file. That's
why we automatically add the context ID in all cases, to prevent this
possibility.
So the WriteFile class does something extra which you may not want, but
it prevents errors in some cases.
In your case that's not what you wanted, but as you saw it's pretty easy
to override WriteFile to do what you want. It was expected that the
default WriteFile would be used in the default osgViewer but users would
make their own version.
Now, I could have added controls in the WriteFile class to be able to
make it do everything you might want, but I preferred to keep the class
simple and make it easy for users to override it if they didn't like the
behavior.
Hope that explains it.
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org