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:
2018-02-08 21:14:26 +11:00
parent 14a19fed78
commit 345c6298e9
89 changed files with 691 additions and 516 deletions

View File

@@ -57,8 +57,9 @@ class MeshMirrorUV(Operator):
precision = self.precision
double_warn = 0
workspace = context.workspace
ob = context.active_object
is_editmode = (ob.mode == 'EDIT')
is_editmode = (workspace.object_mode == 'EDIT')
if is_editmode:
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)