Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-12-06 19:45:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-12-06 22:03:00 +0300
commit6ffcddc10afa07b073ce01c25884e23fc2b661df (patch)
tree86e7ddb017474083890bf16fac4876175a923e57 /source/blender/windowmanager/intern/wm_toolsystem.c
parent7465078e637b729e8b36a4f4b73a50a347052df4 (diff)
Tool System: experimental fallback tool support
Implement T66304 as an experimental option, available under the preferences "Experimental" section. - When enabled most tools in the 3D view have a gizmo. - Dragging outside the gizmo uses the 'fallback' tool. - The fallback tool can be changed or disabled in the tool options or from a pie menu (Alt-W).
Diffstat (limited to 'source/blender/windowmanager/intern/wm_toolsystem.c')
-rw-r--r--source/blender/windowmanager/intern/wm_toolsystem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index f64acf20581..d714fdaa19e 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -351,6 +351,25 @@ void WM_toolsystem_ref_set_from_runtime(struct bContext *C,
*tref->runtime = *tref_rt;
}
+ /* FIXME: ideally Python could check this gizmo group flag and not
+ * pass in the argument to begin with. */
+ bool use_fallback_keymap = false;
+
+ if (U.experimental.use_tool_fallback) {
+ if (tref_rt->gizmo_group[0]) {
+ wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(tref_rt->gizmo_group, false);
+ if (gzgt) {
+ if (gzgt->flag & WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP) {
+ use_fallback_keymap = true;
+ }
+ }
+ }
+ }
+ if (use_fallback_keymap == false) {
+ tref->runtime->idname_fallback[0] = '\0';
+ tref->runtime->keymap_fallback[0] = '\0';
+ }
+
toolsystem_ref_link(C, workspace, tref);
toolsystem_refresh_screen_from_active_tool(bmain, workspace, tref);