[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54944] trunk/blender/source/blender/ editors/mesh/editmesh_select.c: Fix #34366: mesh. select_mode operator could not be configure the use_extend

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Feb 28 17:37:18 CET 2013


Revision: 54944
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54944
Author:   blendix
Date:     2013-02-28 16:37:18 +0000 (Thu, 28 Feb 2013)
Log Message:
-----------
Fix #34366: mesh.select_mode operator could not be configure the use_extend
and use_expand properly. These are hardcoded to shift and ctrl to make them
work when clicking buttons or menus. Now it checks if the properties are set,
which is still not ideal but makes it possible to override them from the
key configuration.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/editmesh_select.c

Modified: trunk/blender/source/blender/editors/mesh/editmesh_select.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_select.c	2013-02-28 16:37:15 UTC (rev 54943)
+++ trunk/blender/source/blender/editors/mesh/editmesh_select.c	2013-02-28 16:37:18 UTC (rev 54944)
@@ -923,9 +923,13 @@
 
 static int edbm_select_mode_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-	// RNA_enum_set(op->ptr, "type");  /* type must be set already */
-	RNA_boolean_set(op->ptr, "use_extend", event->shift);
-	RNA_boolean_set(op->ptr, "use_expand", event->ctrl);
+	/* detecting these options based on shift/ctrl here is weak, but it's done
+	 * to make this work when clicking buttons or menus */
+	if (!RNA_struct_property_is_set(op->ptr, "use_extend"))
+		RNA_boolean_set(op->ptr, "use_extend", event->shift);
+	if (!RNA_struct_property_is_set(op->ptr, "use_expand"))
+		RNA_boolean_set(op->ptr, "use_expand", event->ctrl);
+
 	return edbm_select_mode_exec(C, op);
 }
 




More information about the Bf-blender-cvs mailing list