diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-03-19 13:37:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-03-19 13:37:19 +0300 |
commit | 6222b1ca99856bbeceae31a3260936251db4f4d5 (patch) | |
tree | 0e37d4aa76b5c2310f3bd2d7aec2590be15da7cf /source/blender/python | |
parent | 66374761e1bf545845317930dc9216f7340079a9 (diff) |
saveRenderedImage dosnt work in backgrond mode, so added a warning in the docs and an exception if called.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/api2_2x/doc/Render.py | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/sceneRender.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py index 42fd5b564fe..97c7c0ecc44 100644 --- a/source/blender/python/api2_2x/doc/Render.py +++ b/source/blender/python/api2_2x/doc/Render.py @@ -440,6 +440,7 @@ class RenderData: @type filename: string @since: 2.40 @requires: You must have an image currently rendered before calling this method + @warning: This wont work in background mode. use renderAnim instead. """ def play(): diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index 4bf823bc938..d0440e11b52 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -534,7 +534,11 @@ PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args ) if( !PyArg_ParseTuple( args, "s|i", &name_str, &zbuff ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a filename (string) and optional int" ); - + + if (G.background) + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "saveRenderedImage does not work in background mode, use renderAnim() instead" ); + if( strlen(self->renderContext->pic) + strlen(name_str) >= sizeof(filepath) ) return EXPP_ReturnPyObjError( PyExc_ValueError, |