[Bf-blender-cvs] [d2851b78f09] blender2.8: Manipulator: regression from removing keymaps

Campbell Barton noreply at git.blender.org
Thu Jun 28 12:27:21 CEST 2018


Commit: d2851b78f09995e68d4ca97b5cd98d569b605d77
Author: Campbell Barton
Date:   Thu Jun 28 12:25:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd2851b78f09995e68d4ca97b5cd98d569b605d77

Manipulator: regression from removing keymaps

Keymaps were used to check which tool was active.

===================================================================

M	source/blender/editors/transform/transform_manipulator_3d.c

===================================================================

diff --git a/source/blender/editors/transform/transform_manipulator_3d.c b/source/blender/editors/transform/transform_manipulator_3d.c
index ccf6cc8c7ce..f584a7cf623 100644
--- a/source/blender/editors/transform/transform_manipulator_3d.c
+++ b/source/blender/editors/transform/transform_manipulator_3d.c
@@ -1413,23 +1413,20 @@ static void WIDGETGROUP_manipulator_setup(const bContext *C, wmManipulatorGroup
 	{
 		man->twtype = 0;
 		ScrArea *sa = CTX_wm_area(C);
-		bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL;
-		wmKeyMap *km = tref_rt ? WM_keymap_find_all(C, tref_rt->keymap, sa->spacetype, RGN_TYPE_WINDOW) : NULL;
-		/* Weak, check first event */
-		wmKeyMapItem *kmi = km ? km->items.first : NULL;
+		const bToolRef *tref = sa->runtime.tool;
 
-		if (kmi == NULL) {
+		if (tref == NULL || STREQ(tref->idname, "Transform")) {
 			/* Setup all manipulators, they can be toggled via 'ToolSettings.manipulator_flag' */
 			man->twtype = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
 			man->use_twtype_refresh = true;
 		}
-		else if (STREQ(kmi->idname, "TRANSFORM_OT_translate")) {
+		else if (STREQ(tref->idname, "Move")) {
 			man->twtype |= SCE_MANIP_TRANSLATE;
 		}
-		else if (STREQ(kmi->idname, "TRANSFORM_OT_rotate")) {
+		else if (STREQ(tref->idname, "Rotate")) {
 			man->twtype |= SCE_MANIP_ROTATE;
 		}
-		else if (STREQ(kmi->idname, "TRANSFORM_OT_resize")) {
+		else if (STREQ(tref->idname, "Scale")) {
 			man->twtype |= SCE_MANIP_SCALE;
 		}
 		BLI_assert(man->twtype != 0);



More information about the Bf-blender-cvs mailing list