diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-13 10:59:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-13 10:59:16 +0400 |
commit | 153be23dbe86e031063188ec0e699b7c7d9a71a8 (patch) | |
tree | 372ea549ca99e02c0e92210c68f76b86137b06e1 /source | |
parent | cb499c57ec84e9d8806020b9210f4fb41f7e7e69 (diff) |
give a more useful error when attempting to opengl render in background mode.
add some tips to the python docs.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 66f0e429b76..a3783bdb342 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -46,6 +46,7 @@ #include "DNA_object_types.h" #include "BKE_context.h" +#include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" #include "BKE_report.h" @@ -258,6 +259,11 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) const short is_write_still= RNA_boolean_get(op->ptr, "write_still"); char err_out[256]= "unknown"; + if(G.background) { + BKE_report(op->reports, RPT_ERROR, "Can't use OpenGL render in background mode (no opengl context)"); + return 0; + } + /* ensure we have a 3d view */ if(!ED_view3d_context_activate(C)) { |