Workspace: Move engines to workspace and Properties Editor cleanup
[blender.git] / release / scripts / startup / bl_ui / properties_collection.py
index 9e7d29358a9b2088246628826c440a64a9397471..ae61dc2b74ffd5017ddfbf149457015ccadab4c7 100644 (file)
@@ -50,7 +50,7 @@ class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel):
     @classmethod
     def poll(cls, context):
         scene = context.scene
-        return scene and (scene.render.engine in cls.COMPAT_ENGINES)
+        return scene and (scene.view_render.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
@@ -76,8 +76,8 @@ class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        ob = context.object
-        return ob and (ob.mode == 'OBJECT')
+        workspace = context.workspace
+        return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'OBJECT')
 
     def draw(self, context):
         layout = self.layout
@@ -95,8 +95,8 @@ class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        ob = context.object
-        return ob and (ob.mode == 'EDIT')
+        workspace = context.workspace
+        return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'EDIT')
 
     def draw(self, context):
         layout = self.layout
@@ -119,8 +119,8 @@ class COLLECTION_PT_paint_weight_mode_settings(CollectionButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        ob = context.object
-        return ob and (ob.mode == 'WEIGHT_PAINT')
+        workspace = context.workspace
+        return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'WEIGHT_PAINT')
 
     def draw(self, context):
         layout = self.layout
@@ -138,8 +138,8 @@ class COLLECTION_PT_paint_vertex_mode_settings(CollectionButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        ob = context.object
-        return ob and (ob.mode == 'VERTEX_PAINT')
+        workspace = context.workspace
+        return workspace and hasattr(workspace, 'object_mode') and (workspace.object_mode == 'VERTEX_PAINT')
 
     def draw(self, context):
         layout = self.layout