Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-24 16:20:17 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-26 18:06:14 +0300
commit67b014af484ad4ba6667e3cf9907422bedc8238a (patch)
tree68408128f8377b864c7b77be7c91b1fcead601b7 /source/blender/makesrna/intern/rna_layer.c
parentc490428bd4dff75fb371777d4e95ea270c77ea94 (diff)
Workspaces: active view layer now always comes from workspace, not scene.
Both the scene and workspace had an active view layer, and it was confusing which settings were being used or displayed where. Now we always have one, so there is no mismatch. The "View Layers" tab in the properties editor is now "View Layer", no longer showing a list of layers. Instead view layers can be added and removed with the workspace view layer selector. They are also listed and selectable in the outliner. Single layer rendering uses the active view layer from the workspace. This fixes bugs where the wrong active view layer was used, but more places remain that are wrong and are now using the first view layer in the scene. These are all marked with BKE_view_layer_context_active_PLACEHOLDER.
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index b74cdb5f0a5..93df67306e3 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -864,6 +864,15 @@ static void rna_LayerObjects_active_object_set(PointerRNA *ptr, PointerRNA value
view_layer->basact = NULL;
}
+static char *rna_ViewLayer_path(PointerRNA *ptr)
+{
+ ViewLayer *srl = (ViewLayer *)ptr->data;
+ char name_esc[sizeof(srl->name) * 2];
+
+ BLI_strescape(name_esc, srl->name, sizeof(name_esc));
+ return BLI_sprintfN("view_layers[\"%s\"]", name_esc);
+}
+
static IDProperty *rna_ViewLayer_idprops(PointerRNA *ptr, bool create)
{
ViewLayer *view_layer = (ViewLayer *)ptr->data;
@@ -1017,6 +1026,7 @@ static void rna_def_scene_collection(BlenderRNA *brna)
srna = RNA_def_struct(brna, "SceneCollection", NULL);
RNA_def_struct_ui_text(srna, "Scene Collection", "Collection");
+ RNA_def_struct_ui_icon(srna, ICON_COLLAPSEMENU);
RNA_def_struct_refine_func(srna, "rna_SceneCollection_refine");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
@@ -2020,6 +2030,7 @@ static void rna_def_layer_collection(BlenderRNA *brna)
srna = RNA_def_struct(brna, "LayerCollection", NULL);
RNA_def_struct_ui_text(srna, "Layer Collection", "Layer collection");
+ RNA_def_struct_ui_icon(srna, ICON_COLLAPSEMENU);
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_LayerCollection_name_get", "rna_LayerCollection_name_length", "rna_LayerCollection_name_set");
@@ -2217,7 +2228,8 @@ void RNA_def_view_layer(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ViewLayer", NULL);
RNA_def_struct_ui_text(srna, "Render Layer", "Render layer");
- RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
+ RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT);
+ RNA_def_struct_path_func(srna, "rna_ViewLayer_path");
RNA_def_struct_idprops_func(srna, "rna_ViewLayer_idprops");
rna_def_view_layer_common(srna, 1);