diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 13:14:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-08 13:14:26 +0300 |
commit | 345c6298e995ea618c34282ba6d7ab5af032f191 (patch) | |
tree | f4fbc4798e17d0f19efc28b51a41425d0c552be8 /release/scripts/modules/keyingsets_utils.py | |
parent | 14a19fed788af0cf3695eb5def92510841056e08 (diff) |
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
Diffstat (limited to 'release/scripts/modules/keyingsets_utils.py')
-rw-r--r-- | release/scripts/modules/keyingsets_utils.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/modules/keyingsets_utils.py b/release/scripts/modules/keyingsets_utils.py index 7ce5f3e029b..40e74e27ed2 100644 --- a/release/scripts/modules/keyingsets_utils.py +++ b/release/scripts/modules/keyingsets_utils.py @@ -57,9 +57,10 @@ def path_add_property(path, prop): # selected objects (active object must be in object mode) def RKS_POLL_selected_objects(ksi, context): + workspace = context.workspace ob = context.active_object if ob: - return ob.mode == 'OBJECT' + return workspace.object_mode == 'OBJECT' else: return bool(context.selected_objects) @@ -67,8 +68,9 @@ def RKS_POLL_selected_objects(ksi, context): # selected bones def RKS_POLL_selected_bones(ksi, context): # we must be in Pose Mode, and there must be some bones selected + workspace = context.workspace ob = context.active_object - if ob and ob.mode == 'POSE': + if ob and workspace.object_mode == 'POSE': if context.active_pose_bone or context.selected_pose_bones: return True @@ -87,8 +89,9 @@ def RKS_POLL_selected_items(ksi, context): # all selected objects or pose bones, depending on which we've got def RKS_ITER_selected_item(ksi, context, ks): + workspace = context.workspace ob = context.active_object - if ob and ob.mode == 'POSE': + if ob and workspace.object_mode == 'POSE': for bone in context.selected_pose_bones: ksi.generate(context, ks, bone) else: |