WM: default tool was being set for space types w/o tools

Add mask for space types so we don't accidentally add tools
for space types that don't support it.
This commit is contained in:
2018-10-26 10:42:31 +11:00
parent 6c86e1a781
commit a4a6ed1ba3
4 changed files with 18 additions and 2 deletions

View File

@@ -2398,7 +2398,7 @@ class WM_OT_tool_set_by_name(Operator):
if fn(context, space_type, self.name):
return {'FINISHED'}
else:
self.report({'WARNING'}, f"Tool {self.name!r} not found.")
self.report({'WARNING'}, f"Tool {self.name!r:s} not found for space {space_type!r:s}.")
return {'CANCELLED'}