[Bf-blender-cvs] [3366b333e49] master: Fix switching tools with multiple windows & gizmos

Campbell Barton noreply at git.blender.org
Thu Jun 27 09:26:51 CEST 2019


Commit: 3366b333e49dd0623c3c68c2c04aac66e5028be9
Author: Campbell Barton
Date:   Thu Jun 27 17:22:05 2019 +1000
Branches: master
https://developer.blender.org/rB3366b333e49dd0623c3c68c2c04aac66e5028be9

Fix switching tools with multiple windows & gizmos

The gizmo would only added if the gizmo type wasn't already linked.

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

M	source/blender/windowmanager/intern/wm_toolsystem.c

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

diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index 51b44b630cf..f40ea55ee82 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -177,7 +177,12 @@ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tre
     wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(idname, false);
     if (gzgt != NULL) {
       if ((gzgt->flag & WM_GIZMOGROUPTYPE_TOOL_INIT) == 0) {
-        WM_gizmo_group_type_ensure_ptr(gzgt);
+        if (!WM_gizmo_group_type_ensure_ptr(gzgt)) {
+          /* Even if the group-type was has been linked, it's possible the space types
+           * were not previously using it. (happens with multiple windows.) */
+          wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gzgt->gzmap_params);
+          WM_gizmoconfig_update_tag_init(gzmap_type, gzgt);
+        }
       }
     }
     else {



More information about the Bf-blender-cvs mailing list