[Bf-blender-cvs] [89120d0cb28] temp-workspace-changes: Collection Panel: Get mode from workspace
Dalai Felinto
noreply at git.blender.org
Thu Sep 14 12:09:55 CEST 2017
Commit: 89120d0cb28ade84d7789dca0ce21ef4d7cd492a
Author: Dalai Felinto
Date: Fri Sep 8 22:39:44 2017 +0200
Branches: temp-workspace-changes
https://developer.blender.org/rB89120d0cb28ade84d7789dca0ce21ef4d7cd492a
Collection Panel: Get mode from workspace
Those overrides will change, and this panel may not exist in the future.
But meanwhile let's make things work as tey were supposed to.
===================================================================
M 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 9e7d29358a9..8c96ea0cda1 100644
--- a/release/scripts/startup/bl_ui/properties_collection.py
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -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
More information about the Bf-blender-cvs
mailing list