diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-03 06:04:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-03 06:04:11 +0300 |
commit | b423b891274af6262565e28199c5e53b0cde4374 (patch) | |
tree | 366fce3c08542cbc64b4d96c83f3639a404bfc0d | |
parent | a8ce9a143abbb51eae28e5d0cae1fb310bd0c24c (diff) |
Tool System: enable fallback tool by default
This defaults to selection when not using a gizmo.
The previous behavior to drag anywhere can be set in the tool settings
or by selecting the fallback tool (Alt-W).
See: T66304
9 files changed, 12 insertions, 53 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index a677d9932b6..335a2a633cd 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1804,9 +1804,6 @@ class WM_OT_toolbar_fallback_pie(Operator): return context.space_data is not None def invoke(self, context, event): - if not context.preferences.experimental.use_tool_fallback: - return {'PASS_THROUGH'} - from bl_ui.space_toolsystem_common import ToolSelectPanelHelper space_type = context.space_data.type cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type) diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index 0a42e1232d3..05785b85dfc 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -709,11 +709,7 @@ class ToolSelectPanelHelper: if draw_settings is not None: draw_settings(context, layout, tool) - if context.preferences.experimental.use_tool_fallback: - idname_fallback = tool.idname_fallback - else: - idname_fallback = None - + idname_fallback = tool.idname_fallback if idname_fallback and idname_fallback != item.idname: tool_settings = context.tool_settings diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 5f017e61db7..e0f3a03733e 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -298,10 +298,9 @@ class _defs_transform: layout.label(text="Gizmos:") show_drag = True - if context.preferences.experimental.use_tool_fallback: - tool_settings = context.tool_settings - if tool_settings.workspace_tool_type == 'FALLBACK': - show_drag = False + tool_settings = context.tool_settings + if tool_settings.workspace_tool_type == 'FALLBACK': + show_drag = False if show_drag: props = tool.gizmo_group_properties("VIEW3D_GGT_xform_gizmo") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 03450fc44fb..b497d688339 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -2087,26 +2087,6 @@ class ExperimentalPanel: url_prefix = "https://developer.blender.org/" - -class USERPREF_PT_experimental_ui(ExperimentalPanel, Panel): - bl_label = "User Interface" - - def draw(self, context): - prefs = context.preferences - experimental = prefs.experimental - - layout = self.layout - layout.use_property_split = True - layout.use_property_decorate = False - - task = "T66304" - split = layout.split(factor=0.66) - col = split.column() - col.prop(experimental, "use_tool_fallback", text="Use Tool Fallback") - col = split.column() - col.operator("wm.url_open", text=task, icon='URL').url = self.url_prefix + task - - """ # Example panel, leave it here so we always have a template to follow even # after the features are gone from the experimental panel. @@ -2114,10 +2094,14 @@ class USERPREF_PT_experimental_ui(ExperimentalPanel, Panel): class USERPREF_PT_experimental_virtual_reality(ExperimentalPanel, Panel): bl_label = "Virtual Reality" - def draw_centered(self, context, layout): + def draw(self, context): prefs = context.preferences experimental = prefs.experimental + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + task = "T71347" split = layout.split(factor=0.66) col = split.split() @@ -2242,7 +2226,6 @@ classes = ( USERPREF_PT_studiolight_matcaps, USERPREF_PT_studiolight_world, - USERPREF_PT_experimental_ui, USERPREF_PT_experimental_usd, # Popovers. diff --git a/source/blender/editors/space_view3d/view3d_gizmo_tool_generic.c b/source/blender/editors/space_view3d/view3d_gizmo_tool_generic.c index 8cd5ed7a478..0a4505b1bac 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_tool_generic.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_tool_generic.c @@ -52,10 +52,6 @@ static const char *handle_free_id; static bool WIDGETGROUP_tool_generic_poll(const bContext *C, wmGizmoGroupType *gzgt) { - if (!USER_EXPERIMENTAL_TEST(&U, use_tool_fallback)) { - return false; - } - if (!ED_gizmo_poll_or_unlink_delayed_from_tool(C, gzgt)) { return false; } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 1f92b134e4c..c1a1292325d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -601,10 +601,9 @@ typedef struct UserDef_FileSpaceData { } UserDef_FileSpaceData; typedef struct UserDef_Experimental { - char use_tool_fallback; char use_usd_exporter; - char _pad0[6]; + char _pad0[7]; } UserDef_Experimental; #define USER_EXPERIMENTAL_TEST(userdef, member) \ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b35b1c8b4a1..c5f835ee8b9 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -580,7 +580,6 @@ static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *p return USER_EXPERIMENTAL_TEST(userdef, member); \ } -RNA_USERDEF_EXPERIMENTAL_BOOLEAN_GET(use_tool_fallback) RNA_USERDEF_EXPERIMENTAL_BOOLEAN_GET(use_usd_exporter) static bAddon *rna_userdef_addon_new(void) @@ -5858,12 +5857,6 @@ static void rna_def_userdef_experimental(BlenderRNA *brna) RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Experimental", "Experimental features"); - prop = RNA_def_property(srna, "use_tool_fallback", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "use_tool_fallback", 1); - RNA_def_property_boolean_funcs(prop, "rna_userdef_experimental_use_tool_fallback_get", NULL); - RNA_def_property_ui_text(prop, "Fallback Tool Support", "Allow selection with an active tool"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "use_usd_exporter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_usd_exporter", 1); RNA_def_property_boolean_funcs(prop, "rna_userdef_experimental_use_usd_exporter_get", NULL); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 77d59dd3a8f..8eaba61fb5b 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3751,10 +3751,6 @@ wmEventHandler_Keymap *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap wmKeyMap *WM_event_get_keymap_from_toolsystem_fallback(wmWindowManager *wm, wmEventHandler_Keymap *handler) { - if (!USER_EXPERIMENTAL_TEST(&U, use_tool_fallback)) { - return NULL; - } - ScrArea *sa = handler->dynamic.user_data; handler->keymap_tool = NULL; bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL; diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 45836604109..3218f8c45e4 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -351,11 +351,11 @@ 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 + /* Ideally Python could check this gizmo group flag and not * pass in the argument to begin with. */ bool use_fallback_keymap = false; - if (USER_EXPERIMENTAL_TEST(&U, use_tool_fallback)) { + if (tref->idname_fallback[0] || tref->runtime->keymap_fallback[0]) { if (tref_rt->gizmo_group[0]) { wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(tref_rt->gizmo_group, false); if (gzgt) { |