Object Mode: move to workspace struct

- Read-only access can often use EvaluationContext.object_mode
- Write access to go to WorkSpace.object_mode.
- Some TODO's remain (marked as "TODO/OBMODE")
- Add-ons will need updating
  (context.active_object.mode -> context.workspace.object_mode)
- There will be small/medium issues that still need resolving
  this does work on a basic level though.

See D3037
This commit is contained in:
Campbell Barton
2018-02-08 21:14:26 +11:00
parent 14a19fed78
commit 345c6298e9
89 changed files with 691 additions and 516 deletions

View File

@@ -73,9 +73,10 @@ class QuickFur(Operator):
)
def execute(self, context):
workspace = context.workspace
fake_context = context.copy()
mesh_objects = [obj for obj in context.selected_objects
if obj.type == 'MESH' and obj.mode == 'OBJECT']
if obj.type == 'MESH' and workspace.object_mode == 'OBJECT']
if not mesh_objects:
self.report({'ERROR'}, "Select at least one mesh object")