[Bf-blender-cvs] [5876856f7bd] blender2.8: Properties: remove redundant settings from workspaces tab.

Brecht Van Lommel noreply at git.blender.org
Thu Apr 26 16:38:38 CEST 2018


Commit: 5876856f7bdaac74ae5b09afb5a2c81cdb4f873e
Author: Brecht Van Lommel
Date:   Wed Apr 25 15:56:48 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5876856f7bdaac74ae5b09afb5a2c81cdb4f873e

Properties: remove redundant settings from workspaces tab.

Use render settings and active view layer will be handled elsewhere.
Also change icon to not be confusing with render layers.

Probably we should get rid of the workspace tab entirely and do it in
the user preferences, but that's for later.

===================================================================

M	release/scripts/startup/bl_ui/properties_data_workspace.py
M	source/blender/blenkernel/BKE_workspace.h
M	source/blender/blenkernel/intern/layer.c
M	source/blender/blenkernel/intern/workspace.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/makesdna/DNA_workspace_types.h
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_workspace.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_workspace.py b/release/scripts/startup/bl_ui/properties_data_workspace.py
index e6ac4ab7477..5374aa6b736 100644
--- a/release/scripts/startup/bl_ui/properties_data_workspace.py
+++ b/release/scripts/startup/bl_ui/properties_data_workspace.py
@@ -31,32 +31,6 @@ class WorkSpaceButtonsPanel:
     bl_context = "workspace"
 
 
-class WORKSPACE_PT_context(WorkSpaceButtonsPanel, Panel):
-    bl_label = ""
-    bl_options = {'HIDE_HEADER'}
-
-    def draw(self, context):
-        layout = self.layout
-
-        workspace = context.workspace
-        layout.prop(workspace, "use_scene_settings", icon='SCENE')
-
-
-class WORKSPACE_PT_workspace(WorkSpaceButtonsPanel, Panel):
-    bl_label = "Workspace"
-
-    def draw(self, context):
-        layout = self.layout
-
-        window = context.window
-        workspace = context.workspace
-        scene = context.scene
-
-        layout.enabled = not workspace.use_scene_settings
-
-        layout.template_search(window, "view_layer", scene, "view_layers")
-
-
 class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
     bl_label = "Workspace Add-ons"
     bl_options = {'DEFAULT_CLOSED'}
@@ -118,8 +92,6 @@ class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel):
 
 
 classes = (
-    WORKSPACE_PT_context,
-    WORKSPACE_PT_workspace,
     WORKSPACE_PT_owner_ids,
     WORKSPACE_PT_custom_props,
 )
diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h
index 5dee6b8c44f..5ee15a08f9b 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -109,10 +109,6 @@ struct WorkSpaceLayout *BKE_workspace_hook_layout_for_workspace_get(
 void             BKE_workspace_hook_layout_for_workspace_set(
         struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL();
 
-/* flags */
-bool BKE_workspace_use_scene_settings_get(const struct WorkSpace *workspace) GETTER_ATTRS;
-void BKE_workspace_use_scene_settings_set(struct WorkSpace *workspace, bool value) SETTER_ATTRS;
-
 /* Update / evaluate */
 void BKE_workspace_update_tagged(struct Main *bmain,
                                  struct WorkSpace *workspace,
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 15585d852b9..41bdc3bb9ef 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -91,12 +91,7 @@ ViewLayer *BKE_view_layer_from_scene_get(const Scene *scene)
  */
 ViewLayer *BKE_view_layer_from_workspace_get(const struct Scene *scene, const struct WorkSpace *workspace)
 {
-	if (BKE_workspace_use_scene_settings_get(workspace)) {
-		return BKE_view_layer_from_scene_get(scene);
-	}
-	else {
-		return BKE_workspace_view_layer_get(workspace, scene);
-	}
+	return BKE_workspace_view_layer_get(workspace, scene);
 }
 
 /**
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index 8de62f82c1b..38378f66584 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -440,22 +440,6 @@ void BKE_workspace_hook_layout_for_workspace_set(
 	workspace_relation_ensure_updated(&workspace->hook_layout_relations, hook, layout);
 }
 
-/* Flags */
-bool BKE_workspace_use_scene_settings_get(const WorkSpace *workspace)
-{
-	return (workspace->flags & WORKSPACE_USE_SCENE_SETTINGS) != 0;
-}
-
-void BKE_workspace_use_scene_settings_set(WorkSpace *workspace, bool value)
-{
-	if (value) {
-		workspace->flags |= WORKSPACE_USE_SCENE_SETTINGS;
-	}
-	else {
-		workspace->flags &= ~WORKSPACE_USE_SCENE_SETTINGS;
-	}
-}
-
 /* Update / evaluate */
 
 void BKE_workspace_update_tagged(Main *bmain,
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index b7ba8b5e065..e8faf794bb8 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -501,8 +501,6 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
 	memset(path, 0, sizeof(*path));
 	path->flag = flag;
 
-	const bool use_scene_settings = BKE_workspace_use_scene_settings_get(workspace);
-
 	/* If some ID datablock is pinned, set the root pointer. */
 	if (sbuts->pinid) {
 		id = sbuts->pinid;
@@ -512,8 +510,8 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
 	}
 	/* No pinned root, use scene or workspace as initial root. */
 	else {
-		if ((mainb != BCONTEXT_WORKSPACE) && (use_scene_settings ||
-		    ELEM(mainb, BCONTEXT_SCENE, BCONTEXT_RENDER, BCONTEXT_VIEW_LAYER, BCONTEXT_WORLD)))
+		if ((mainb != BCONTEXT_WORKSPACE) &&
+		    ELEM(mainb, BCONTEXT_SCENE, BCONTEXT_RENDER, BCONTEXT_VIEW_LAYER, BCONTEXT_WORLD))
 		{
 			RNA_id_pointer_create(&scene->id, &path->ptr[0]);
 			path->len++;
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
index baa6d0f94db..1f1c69ad083 100644
--- a/source/blender/makesdna/DNA_workspace_types.h
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -155,7 +155,6 @@ typedef struct WorkSpaceInstanceHook {
 } WorkSpaceInstanceHook;
 
 typedef enum eWorkSpaceFlags {
-	WORKSPACE_USE_SCENE_SETTINGS = (1 << 0),
 	WORKSPACE_USE_FILTER_BY_ORIGIN = (1 << 1),
 } eWorkSpaceFlags;
 
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 5a4e23699b8..5d430e5d7b9 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -214,7 +214,7 @@ static const EnumPropertyItem buttons_context_items[] = {
 	{BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
 	{BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
 	{BCONTEXT_COLLECTION, "COLLECTION", ICON_COLLAPSEMENU, "Collection", "Collection"},
-	{BCONTEXT_WORKSPACE, "WORKSPACE", ICON_RENDER_RESULT, "Workspace", "Workspace"},
+	{BCONTEXT_WORKSPACE, "WORKSPACE", ICON_SPLITSCREEN, "Workspace", "Workspace"},
 	{0, NULL, 0, NULL, NULL}
 };
 
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c
index c48e80ad349..30670c83ba8 100644
--- a/source/blender/makesrna/intern/rna_workspace.c
+++ b/source/blender/makesrna/intern/rna_workspace.c
@@ -168,7 +168,7 @@ static void rna_def_workspace(BlenderRNA *brna)
 	RNA_def_struct_sdna(srna, "WorkSpace");
 	RNA_def_struct_ui_text(srna, "Workspace", "Workspace data-block, defining the working environment for the user");
 	/* TODO: real icon, just to show something */
-	RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT);
+	RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
 
 	prop = RNA_def_property(srna, "screens", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_collection_sdna(prop, NULL, "layouts", NULL);
@@ -204,13 +204,6 @@ static void rna_def_workspace(BlenderRNA *brna)
 #endif
 
 	/* Flags */
-	prop = RNA_def_property(srna, "use_scene_settings", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flags", WORKSPACE_USE_SCENE_SETTINGS);
-	RNA_def_property_ui_text(prop, "Scene Settings",
-	                         "Use scene settings instead of workspace settings");
-	RNA_def_property_update(prop, NC_SCREEN | ND_LAYER, NULL);
-
 	prop = RNA_def_property(srna, "use_filter_by_owner", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flags", WORKSPACE_USE_FILTER_BY_ORIGIN);



More information about the Bf-blender-cvs mailing list