UI: Improvements to shading layout

Improve labels and UI consistency.

- Update color labels: Object, Wireframe, Background
- Rename 'Single' shading color to 'Custom'. Move to the end.
- Rename 'Viewport' color to 'Custom' for consistency.
- Fix alignment of Object Color item labels

Pull Request: https://projects.blender.org/blender/blender/pulls/137408
This commit is contained in:
Aaron Carlisle
2025-05-14 16:24:51 +02:00
committed by Pablo Vazquez
parent 8f232517f0
commit 6329e00cd1
4 changed files with 35 additions and 35 deletions

View File

@@ -959,7 +959,7 @@ class RENDER_PT_opengl_lighting(RenderButtonsPanel, Panel):
class RENDER_PT_opengl_color(RenderButtonsPanel, Panel):
bl_label = "Color"
bl_label = "Object Color"
COMPAT_ENGINES = {'BLENDER_WORKBENCH'}
@classmethod

View File

@@ -6568,13 +6568,13 @@ class VIEW3D_PT_shading_lighting(Panel):
shading = VIEW3D_PT_shading.get_shading(context)
col = layout.column()
split = col.split(factor=0.9)
split = col.split(factor=0.95)
if shading.type == 'SOLID':
split.row().prop(shading, "light", expand=True)
col.row().prop(shading, "light", expand=True)
col = split.column()
split = layout.split(factor=0.9)
split = layout.split(factor=0.95)
col = split.column()
sub = col.row()
@@ -6597,12 +6597,12 @@ class VIEW3D_PT_shading_lighting(Panel):
col = split.column()
col.operator("screen.userpref_show", emboss=False, text="", icon='PREFERENCES').section = 'LIGHTS'
split = layout.split(factor=0.9)
split = layout.split(factor=0.95)
col = split.column()
row = col.row()
row = col.row(align=True)
row.prop(shading, "use_world_space_lighting", text="", icon='WORLD', toggle=True)
row = row.row()
row = row.row(align=True)
row.active = shading.use_world_space_lighting
row.prop(shading, "studiolight_rotate_z", text="Rotation")
col = split.column() # to align properly with above
@@ -6619,7 +6619,7 @@ class VIEW3D_PT_shading_lighting(Panel):
col.prop(shading, "use_scene_lights")
col.prop(shading, "use_scene_world")
col = layout.column()
split = col.split(factor=0.9)
split = col.split(factor=0.95)
if not shading.use_scene_world:
col = split.column()
@@ -6630,7 +6630,7 @@ class VIEW3D_PT_shading_lighting(Panel):
col = split.column()
col.operator("screen.userpref_show", emboss=False, text="", icon='PREFERENCES').section = 'LIGHTS'
split = layout.split(factor=0.9)
split = layout.split(factor=0.95)
col = split.column()
engine = context.scene.render.engine
@@ -6651,7 +6651,7 @@ class VIEW3D_PT_shading_lighting(Panel):
if not shading.use_scene_world_render:
col = layout.column()
split = col.split(factor=0.9)
split = col.split(factor=0.95)
col = split.column()
sub = col.row()
@@ -6661,12 +6661,11 @@ class VIEW3D_PT_shading_lighting(Panel):
col = split.column()
col.operator("screen.userpref_show", emboss=False, text="", icon='PREFERENCES').section = 'LIGHTS'
split = layout.split(factor=0.9)
split = layout.split(factor=0.95)
col = split.column()
col.prop(shading, "studiolight_rotate_z", text="Rotation")
col.prop(shading, "studiolight_intensity")
col.prop(shading, "studiolight_background_alpha")
engine = context.scene.render.engine
col.prop(shading, "studiolight_background_blur")
col = split.column() # to align properly with above
@@ -6674,14 +6673,14 @@ class VIEW3D_PT_shading_lighting(Panel):
class VIEW3D_PT_shading_color(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
bl_label = "Wire Color"
bl_label = "Wireframe Color"
bl_parent_id = "VIEW3D_PT_shading"
def _draw_color_type(self, context):
layout = self.layout
shading = VIEW3D_PT_shading.get_shading(context)
layout.grid_flow(columns=3, align=True).prop(shading, "color_type", expand=True)
layout.grid_flow(row_major=True, columns=3, align=True).prop(shading, "color_type", expand=True)
if shading.color_type == 'SINGLE':
layout.row().prop(shading, "single_color", text="")
@@ -6702,7 +6701,7 @@ class VIEW3D_PT_shading_color(Panel):
self.layout.separator()
if shading.type == 'SOLID':
layout.row().label(text="Color")
layout.row().label(text="Object Color")
self._draw_color_type(context)
self.layout.separator()
self._draw_background_color(context)
@@ -6731,6 +6730,20 @@ class VIEW3D_PT_shading_options(Panel):
if shading.type == 'SOLID':
col.prop(shading, "show_backface_culling")
if shading.type in {'WIREFRAME', 'SOLID'}:
row = col.split()
row.prop(shading, "show_object_outline")
sub = row.row()
sub.active = shading.show_object_outline
sub.prop(shading, "object_outline_color", text="")
if shading.type == 'SOLID':
col = col.column()
if shading.light in {'STUDIO', 'MATCAP'}:
studio_light = shading.selected_studio_light
col.active = (studio_light is not None) and studio_light.has_specular_highlight_pass
col.prop(shading, "show_specular_highlight", text="Specular Lighting")
row = col.row(align=True)
if shading.type == 'WIREFRAME':
@@ -6762,25 +6775,12 @@ class VIEW3D_PT_shading_options(Panel):
row.active = not xray_active
row.prop(shading, "use_dof", text="Depth of Field")
if shading.type in {'WIREFRAME', 'SOLID'}:
row = col.split()
row.prop(shading, "show_object_outline")
sub = row.row()
sub.active = shading.show_object_outline
sub.prop(shading, "object_outline_color", text="")
if shading.type == 'SOLID':
col = col.column()
if shading.light in {'STUDIO', 'MATCAP'}:
studio_light = shading.selected_studio_light
col.active = (studio_light is not None) and studio_light.has_specular_highlight_pass
col.prop(shading, "show_specular_highlight", text="Specular Lighting")
class VIEW3D_PT_shading_options_shadow(Panel):
bl_label = "Shadow Settings"
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
bl_ui_units_x = 12
def draw(self, context):
layout = self.layout
@@ -6788,9 +6788,9 @@ class VIEW3D_PT_shading_options_shadow(Panel):
scene = context.scene
col = layout.column()
col.prop(scene.display, "light_direction")
col.prop(scene.display, "shadow_shift")
col.prop(scene.display, "shadow_focus")
col.prop(scene.display, "light_direction", text="Direction")
col.prop(scene.display, "shadow_shift", text="Offset")
col.prop(scene.display, "shadow_focus", text="Focus")
class VIEW3D_PT_shading_options_ssao(Panel):

View File

@@ -449,10 +449,10 @@ int uiLayoutGetLocalDir(const uiLayout *layout)
case uiItemType::LayoutRoot:
case uiItemType::LayoutOverlap:
case uiItemType::LayoutPanelHeader:
case uiItemType::LayoutGridFlow:
return UI_LAYOUT_HORIZONTAL;
case uiItemType::LayoutColumn:
case uiItemType::LayoutColumnFlow:
case uiItemType::LayoutGridFlow:
case uiItemType::LayoutSplit:
case uiItemType::LayoutAbsolute:
case uiItemType::LayoutBox:

View File

@@ -416,7 +416,6 @@ static const EnumPropertyItem rna_enum_viewport_lighting_items[] = {
static const EnumPropertyItem rna_enum_shading_color_type_items[] = {
{V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"},
{V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Single", "Show scene in a single color"},
{V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"},
{V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"},
{V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Attribute", "Show active color attribute"},
@@ -425,6 +424,7 @@ static const EnumPropertyItem rna_enum_shading_color_type_items[] = {
0,
"Texture",
"Show the texture from the active image texture node using the active UV map coordinates"},
{V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Custom", "Show scene in a single custom color"},
{0, nullptr, 0, nullptr, nullptr},
};
@@ -4253,7 +4253,7 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
{V3D_SHADING_BACKGROUND_VIEWPORT,
"VIEWPORT",
0,
"Viewport",
"Custom",
"Use a custom color limited to this viewport only"},
{0, nullptr, 0, nullptr, nullptr},
};