Tool System: use context mode

Was using object mode in the workspace API which isn't
useful for accessing tools.
This commit is contained in:
2018-05-17 20:28:14 +02:00
parent 486ff7e52c
commit b0c8d35142
6 changed files with 31 additions and 26 deletions

View File

@@ -284,8 +284,7 @@ class ToolSelectPanelHelper:
def _tool_active_from_context(context, space_type, mode=None, create=False):
if space_type == 'VIEW_3D':
if mode is None:
obj = context.active_object
mode = obj.mode if obj is not None else 'OBJECT'
mode = context.mode
tool = context.workspace.tools.from_space_view3d_mode(mode, create)
if tool is not None:
return tool