diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-06 19:31:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-06 19:31:32 +0300 |
commit | 3e998b886080d3cd11137327356d1c861ae7ddb4 (patch) | |
tree | ad013e26fba3788f26bdd1528fc5d0623ae4bf81 | |
parent | 4a2b64e43d30a58de7f6d677ea43ffbd656265c7 (diff) |
Fix object mode workspace check
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_collection.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index c91efc36279..163131392e3 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -753,7 +753,7 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel): col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP' col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN' - if context.workspace.object_mode == 'EDIT': + if ob.mode == 'EDIT': row = layout.row(align=True) row.operator("object.material_slot_assign", text="Assign") row.operator("object.material_slot_select", text="Select") diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index f093b373251..e48df3a0a61 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -91,7 +91,8 @@ class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.workspace.object_mode == 'OBJECT' + ob = context.object + return ob and ob.mode == 'OBJECT' def draw(self, context): layout = self.layout @@ -109,7 +110,8 @@ class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.workspace.object_mode == 'EDIT' + ob = context.object + return ob and ob.mode == 'EDIT' def draw(self, context): layout = self.layout @@ -132,7 +134,8 @@ class COLLECTION_PT_paint_weight_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.workspace.object_mode == 'WEIGHT_PAINT' + ob = context.object + return ob and ob.mode == 'WEIGHT_PAINT' def draw(self, context): layout = self.layout @@ -150,7 +153,8 @@ class COLLECTION_PT_paint_vertex_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - return context.workspace.object_mode == 'VERTEX_PAINT' + ob = context.object + return ob and ob.mode == 'VERTEX_PAINT' def draw(self, context): layout = self.layout |