[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43344] trunk/blender: give a more useful error when attempting to opengl render in background mode .

Campbell Barton ideasman42 at gmail.com
Fri Jan 13 07:59:17 CET 2012


Revision: 43344
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43344
Author:   campbellbarton
Date:     2012-01-13 06:59:16 +0000 (Fri, 13 Jan 2012)
Log Message:
-----------
give a more useful error when attempting to opengl render in background mode.
add some tips to the python docs.

Modified Paths:
--------------
    trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst
    trunk/blender/source/blender/editors/render/render_opengl.c

Modified: trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst
===================================================================
--- trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst	2012-01-13 06:58:15 UTC (rev 43343)
+++ trunk/blender/doc/python_api/rst/info_tips_and_tricks.rst	2012-01-13 06:59:16 UTC (rev 43344)
@@ -26,6 +26,27 @@
    For Linux and OSX users this means starting the terminal first, then running blender from within it. On Windows the terminal can be enabled from the help menu.
 
 
+Interface Tricks
+================
+
+
+Access Operator Commands
+------------------------
+
+You may have noticed that the tooltip for menu items and buttons includes the ``bpy.ops``... command to run that button, a handy (hidden) feature is that you can press Ctrl+C over any menu item/button to copy this command into the clipboard.
+
+
+Access Data Path
+----------------
+
+To find the path from an :class:`ID` datablock to its setting isn't always so simple since it may be nested away. To get this quickly you can right click on the setting and select select **Copy Data Path**,
+if this can't be generated, only the property name is copied.
+
+.. note::
+
+   This uses the same method for creating the animation path used by :class:`FCurve.data_path` and :class:`DriverTarget.data_path` drivers.
+
+
 Show All Operators
 ==================
 

Modified: trunk/blender/source/blender/editors/render/render_opengl.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_opengl.c	2012-01-13 06:58:15 UTC (rev 43343)
+++ trunk/blender/source/blender/editors/render/render_opengl.c	2012-01-13 06:59:16 UTC (rev 43344)
@@ -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 @@
 	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)) {




More information about the Bf-blender-cvs mailing list