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 /release/scripts/startup/bl_ui/properties_view_layer.py
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 'release/scripts/startup/bl_ui/properties_view_layer.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_view_layer.py34
1 files changed, 7 insertions, 27 deletions
diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py b/release/scripts/startup/bl_ui/properties_view_layer.py
index 28fd5bf666f..842a3f36fa2 100644
--- a/release/scripts/startup/bl_ui/properties_view_layer.py
+++ b/release/scripts/startup/bl_ui/properties_view_layer.py
@@ -32,21 +32,8 @@ class ViewLayerButtonsPanel:
return (context.engine in cls.COMPAT_ENGINES)
-class VIEWLAYER_UL_viewlayers(UIList):
- def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
- # assert(isinstance(item, bpy.types.SceneLayer)
- layer = item
- if self.layout_type in {'DEFAULT', 'COMPACT'}:
- layout.prop(layer, "name", text="", icon_value=icon, emboss=False)
- layout.prop(layer, "use", text="", index=index)
- elif self.layout_type == 'GRID':
- layout.alignment = 'CENTER'
- layout.label("", icon_value=icon)
-
-
-class VIEWLAYER_PT_layers(ViewLayerButtonsPanel, Panel):
- bl_label = "Layer List"
- bl_options = {'HIDE_HEADER'}
+class VIEWLAYER_PT_layer(ViewLayerButtonsPanel, Panel):
+ bl_label = "View Layer"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
def draw(self, context):
@@ -54,16 +41,10 @@ class VIEWLAYER_PT_layers(ViewLayerButtonsPanel, Panel):
scene = context.scene
rd = scene.render
+ layer = bpy.context.view_layer
- row = layout.row()
- col = row.column()
- col.template_list("VIEWLAYER_UL_viewlayers", "", scene, "view_layers", scene.view_layers, "active_index", rows=2)
-
- col = row.column()
- sub = col.column(align=True)
- sub.operator("scene.view_layer_add", icon='ZOOMIN', text="")
- sub.operator("scene.view_layer_remove", icon='ZOOMOUT', text="")
- col.prop(rd, "use_single_layer", icon_only=True)
+ layout.prop(layer, "use", text="Use for Rendering");
+ layout.prop(rd, "use_single_layer", text="Render Single Layer")
class VIEWLAYER_PT_clay_settings(ViewLayerButtonsPanel, Panel):
@@ -385,7 +366,7 @@ class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
scene = context.scene
rd = scene.render
- view_layer = scene.view_layers.active
+ view_layer = context.view_layer
split = layout.split()
@@ -405,8 +386,7 @@ class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
classes = (
- VIEWLAYER_UL_viewlayers,
- VIEWLAYER_PT_layers,
+ VIEWLAYER_PT_layer,
VIEWLAYER_PT_clay_settings,
VIEWLAYER_PT_eevee_sampling,
VIEWLAYER_PT_eevee_shadows,