Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-02-08 13:14:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-08 13:14:26 +0300
commit345c6298e995ea618c34282ba6d7ab5af032f191 (patch)
treef4fbc4798e17d0f19efc28b51a41425d0c552be8 /release/scripts/startup/bl_ui/properties_data_bone.py
parent14a19fed788af0cf3695eb5def92510841056e08 (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/startup/bl_ui/properties_data_bone.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_bone.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index f0ef0032059..e8f290772d8 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -58,7 +58,8 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
return True
ob = context.object
- return ob and ob.mode == 'POSE' and context.bone
+ workspace = context.workspace
+ return ob and workspace.object_mode == 'POSE' and context.bone
def draw(self, context):
layout = self.layout
@@ -110,7 +111,8 @@ class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
@classmethod
def poll(cls, context):
ob = context.object
- return ob and ob.mode == 'POSE' and context.bone
+ workspace = context.workspace
+ return ob and workspace.object_mode == 'POSE' and context.bone
def draw(self, context):
layout = self.layout
@@ -311,7 +313,8 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
@classmethod
def poll(cls, context):
ob = context.object
- return ob and ob.mode == 'POSE' and context.bone
+ workspace = context.workspace
+ return ob and workspace.object_mode == 'POSE' and context.bone
def draw(self, context):
layout = self.layout
@@ -439,7 +442,8 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
@property
def _context_path(self):
obj = bpy.context.object
- if obj and obj.mode == 'POSE':
+ workspace = context.workspace
+ if obj and workspace.object_mode == 'POSE':
return "active_pose_bone"
else:
return "active_bone"