From 30d0194585464631b7e75879f977355a1b125add Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 19 Feb 2018 09:53:39 -0300 Subject: Fix collection object mode panels They were broken since we moved object mode into workspace. --- release/scripts/startup/bl_ui/properties_collection.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'release/scripts/startup/bl_ui/properties_collection.py') diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index 9a8e0a7562a..f093b373251 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -91,8 +91,7 @@ class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - window = context.window - return window and hasattr(window, 'object_mode') and (window.object_mode == 'OBJECT') + return context.workspace.object_mode == 'OBJECT' def draw(self, context): layout = self.layout @@ -110,8 +109,7 @@ class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - window = context.window - return window and hasattr(window, 'object_mode') and (window.object_mode == 'EDIT') + return context.workspace.object_mode == 'EDIT' def draw(self, context): layout = self.layout @@ -134,8 +132,7 @@ class COLLECTION_PT_paint_weight_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - window = context.window - return window and hasattr(window, 'object_mode') and (window.object_mode == 'WEIGHT_PAINT') + return context.workspace.object_mode == 'WEIGHT_PAINT' def draw(self, context): layout = self.layout @@ -153,8 +150,7 @@ class COLLECTION_PT_paint_vertex_mode_settings(CollectionButtonsPanel, Panel): @classmethod def poll(cls, context): - window = context.window - return window and hasattr(window, 'object_mode') and (window.object_mode == 'VERTEX_PAINT') + return context.workspace.object_mode == 'VERTEX_PAINT' def draw(self, context): layout = self.layout -- cgit v1.2.3