[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47856] trunk/blender/source/blender/ editors/transform/transform_ops.c: [#26630] Several problems with API constraint_orientation

Dan Eicher dan at trollwerks.org
Thu Jun 14 01:04:33 CEST 2012


Revision: 47856
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47856
Author:   dna
Date:     2012-06-13 23:04:32 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
[#26630] Several problems with API constraint_orientation

Added a check to TRANSFORM_OT_create_orientation so it throws an exception instead of crashing blender (due to invalid view3d)

Can still create an orientation from the console just can't set it to active with the 'use' parameter

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform_ops.c

Modified: trunk/blender/source/blender/editors/transform/transform_ops.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_ops.c	2012-06-13 22:38:31 UTC (rev 47855)
+++ trunk/blender/source/blender/editors/transform/transform_ops.c	2012-06-13 23:04:32 UTC (rev 47856)
@@ -40,6 +40,7 @@
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_armature.h"
+#include "BKE_report.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -282,6 +283,11 @@
 	
 	RNA_string_get(op->ptr, "name", name);
 
+	if (use && !CTX_wm_view3d(C)) {
+		BKE_report(op->reports, RPT_ERROR, "Create Orientation \"use\" parameter only valid in a 3dView context");
+		return OPERATOR_CANCELLED;
+	}
+
 	BIF_createTransformOrientation(C, op->reports, name, use, overwrite);
 
 	WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));




More information about the Bf-blender-cvs mailing list