diff options
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_freestyle.py | 18 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_view_layer.py | 34 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 8 |
4 files changed, 24 insertions, 38 deletions
diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py index 84ebb21c703..a9c9d512335 100644 --- a/release/scripts/startup/bl_ui/properties_freestyle.py +++ b/release/scripts/startup/bl_ui/properties_freestyle.py @@ -71,11 +71,11 @@ class ViewLayerFreestyleButtonsPanel: @classmethod def poll(cls, context): scene = context.scene - rd = context.scene.render + rd = scene.render with_freestyle = bpy.app.build_options.freestyle return (scene and with_freestyle and rd.use_freestyle and - scene.view_layers.active and(context.engine in cls.COMPAT_ENGINES)) + (context.engine in cls.COMPAT_ENGINES)) class ViewLayerFreestyleEditorButtonsPanel(ViewLayerFreestyleButtonsPanel): @@ -85,7 +85,7 @@ class ViewLayerFreestyleEditorButtonsPanel(ViewLayerFreestyleButtonsPanel): def poll(cls, context): if not super().poll(context): return False - view_layer = context.scene.view_layers.active + view_layer = context.view_layer return view_layer and view_layer.freestyle_settings.mode == 'EDITOR' @@ -117,7 +117,7 @@ class VIEWLAYER_PT_freestyle(ViewLayerFreestyleButtonsPanel, Panel): layout = self.layout scene = context.scene - view_layer = scene.view_layers.active + view_layer = context.view_layer freestyle = view_layer.freestyle_settings layout.active = view_layer.use_freestyle @@ -186,7 +186,7 @@ class VIEWLAYER_PT_freestyle_lineset(ViewLayerFreestyleEditorButtonsPanel, Panel scene = context.scene rd = scene.render - view_layer = scene.view_layers.active + view_layer = context.view_layer freestyle = view_layer.freestyle_settings lineset = freestyle.linesets.active @@ -378,7 +378,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan row = box.row(align=True) row.prop(modifier, "curvature_min") row.prop(modifier, "curvature_max") - freestyle = context.scene.view_layers.active.freestyle_settings + freestyle = context.view_layer.freestyle_settings if not freestyle.use_smoothness: message = "Enable Face Smoothness to use this modifier" self.draw_modifier_box_error(col.box(), modifier, message) @@ -433,7 +433,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan row = box.row(align=True) row.prop(modifier, "curvature_min") row.prop(modifier, "curvature_max") - freestyle = context.scene.view_layers.active.freestyle_settings + freestyle = context.view_layer.freestyle_settings if not freestyle.use_smoothness: message = "Enable Face Smoothness to use this modifier" self.draw_modifier_box_error(col.box(), modifier, message) @@ -505,7 +505,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan row = box.row(align=True) row.prop(modifier, "curvature_min") row.prop(modifier, "curvature_max") - freestyle = context.scene.view_layers.active.freestyle_settings + freestyle = context.view_layer.freestyle_settings if not freestyle.use_smoothness: message = "Enable Face Smoothness to use this modifier" self.draw_modifier_box_error(col.box(), modifier, message) @@ -614,7 +614,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan layout = self.layout scene = context.scene - view_layer = scene.view_layers.active + view_layer = context.view_layer lineset = view_layer.freestyle_settings.linesets.active layout.active = view_layer.use_freestyle 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, diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index f97c88be0ad..23d822bbf1f 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -79,7 +79,7 @@ class NODE_HT_header(Header): row.prop(snode_id, "use_nodes") if snode.shader_type == 'LINESTYLE': - view_layer = context.scene.view_layers.active + view_layer = context.view_layer lineset = view_layer.freestyle_settings.linesets.active if lineset is not None: row = layout.row() diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 3eded5e0b46..b6d88dc5a6e 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -85,7 +85,13 @@ class TOPBAR_HT_upper_bar(Header): # Active workspace view-layer is retrieved through window, not through workspace. layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete") - layout.template_search(window, "view_layer", scene, "view_layers") + + row = layout.row(align=True) + row.template_search( + window, "view_layer", + scene, "view_layers", + new="scene.view_layer_add", + unlink="scene.view_layer_remove") class TOPBAR_HT_lower_bar(Header): |