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 /release/scripts/startup/bl_ui/properties_collection.py | |
parent | 4a2b64e43d30a58de7f6d677ea43ffbd656265c7 (diff) |
Fix object mode workspace check
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_collection.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_collection.py | 12 |
1 files changed, 8 insertions, 4 deletions
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 |