WIP: Custom build, mostly selection options #105712
|
@ -949,6 +949,17 @@ class VIEW3D_HT_header(Header):
|
|||
row.popover(panel="VIEW3D_PT_xray", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
if tool_settings.shrink_shading_header:
|
||||
if shading.type == 'SOLID':
|
||||
shadicon = 'SHADING_SOLID'
|
||||
elif shading.type == 'MATERIAL':
|
||||
shadicon = 'SHADING_TEXTURE'
|
||||
elif shading.type == 'RENDERED':
|
||||
shadicon = 'SHADING_RENDERED'
|
||||
else:
|
||||
shadicon = 'SHADING_WIRE'
|
||||
row.operator("view3d.toggle_xray", text="", icon=shadicon, depress=draw_depressed)
|
||||
else:
|
||||
row.prop(shading, "type", text="", expand=True)
|
||||
sub = row.row(align=True)
|
||||
# TODO, currently render shading type ignores mesh two-side, until it's supported
|
||||
|
@ -5929,6 +5940,12 @@ class VIEW3D_PT_shading(Panel):
|
|||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
layout.label(text="Viewport Shading")
|
||||
tool_settings = _context.tool_settings
|
||||
shading = VIEW3D_PT_shading.get_shading(_context)
|
||||
|
||||
layout.prop(tool_settings, "shrink_shading_header")
|
||||
if tool_settings.shrink_shading_header:
|
||||
layout.prop(shading, "type", text = '', expand=True)
|
||||
|
||||
|
||||
class VIEW3D_PT_shading_lighting(Panel):
|
||||
|
@ -5941,6 +5958,7 @@ class VIEW3D_PT_shading_lighting(Panel):
|
|||
def poll(cls, context):
|
||||
shading = VIEW3D_PT_shading.get_shading(context)
|
||||
engine = context.scene.render.engine
|
||||
|
||||
return shading.type in {'SOLID', 'MATERIAL'} or engine == 'BLENDER_EEVEE' and shading.type == 'RENDERED'
|
||||
|
||||
def draw(self, context):
|
||||
|
|
|
@ -1746,7 +1746,10 @@ typedef struct ToolSettings {
|
|||
char show_box_options;
|
||||
char show_lasso_options;
|
||||
char show_circle_options;
|
||||
char _pad6[7];
|
||||
|
||||
/* Combine shading and xray header buttons */
|
||||
char shrink_shading_header;
|
||||
char _pad6[6];
|
||||
|
||||
/**
|
||||
* Custom Curve Profile for bevel tool:
|
||||
|
|
|
@ -4062,12 +4062,18 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(prop, "Normal Vector", "Normal Vector used to copy, add or multiply");
|
||||
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
|
||||
|
||||
/* UI prop helper, so you can use a heading without a real property or operator on the same line */
|
||||
/* UI prop helper, might help with formatting and using headings on a blank line, unused for now */
|
||||
prop = RNA_def_property(srna, "ui_prop", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "ui_prop", 0);
|
||||
RNA_def_property_ui_text(prop, "UI Prop", "");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
/* Shrink Shading Header */
|
||||
prop = RNA_def_property(srna, "shrink_shading_header", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "shrink_shading_header", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Shrink Header", "Combine the four Shading Header buttons into one button that also toggles X-Ray");
|
||||
|
||||
/* X-Ray header button */
|
||||
prop = RNA_def_property(srna, "xray_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "xray_button", 0);
|
||||
|
|
Loading…
Reference in New Issue