UI: more single column layout for brush and render properties.

This commit is contained in:
William Reynish 2018-10-31 17:23:43 +01:00 committed by Brecht Van Lommel
parent a2a8e71210
commit 4b7b1ba114
5 changed files with 433 additions and 218 deletions

@ -763,27 +763,36 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, Panel):
view_layer = context.view_layer
cycles_view_layer = view_layer.cycles
col = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(view_layer, "use_pass_combined")
col = flow.column()
col.prop(view_layer, "use_pass_z")
col = flow.column()
col.prop(view_layer, "use_pass_mist")
col = flow.column()
col.prop(view_layer, "use_pass_normal")
row = col.row()
row.prop(view_layer, "use_pass_vector")
row.active = not rd.use_motion_blur
col = flow.column()
col.prop(view_layer, "use_pass_vector")
col.active = not rd.use_motion_blur
col = flow.column()
col.prop(view_layer, "use_pass_uv")
col = flow.column()
col.prop(view_layer, "use_pass_object_index")
col = flow.column()
col.prop(view_layer, "use_pass_material_index")
col.separator()
layout.separator()
col = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(cycles_view_layer, "denoising_store_passes", text="Denoising Data")
col = flow.column()
col.prop(cycles_view_layer, "pass_debug_render_time", text="Render Time")
col.separator()
layout.separator()
col.prop(view_layer, "pass_alpha_threshold")
layout.prop(view_layer, "pass_alpha_threshold")
class CYCLES_RENDER_PT_passes_light(CyclesButtonsPanel, Panel):
@ -929,30 +938,50 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
layout.separator()
row = layout.row(align=True)
row.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
row.label(text="Diffuse")
split = layout.split(factor=0.5)
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
col = split.column()
col.alignment = 'RIGHT'
col.label(text="Diffuse")
row = split.row(align=True)
row.use_property_split = False
row.prop(cycles_view_layer, "denoising_diffuse_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect", toggle=True)
row = layout.row(align=True)
row.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
row.label(text="Glossy")
split = layout.split(factor=0.5)
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
col = split.column()
col.alignment = 'RIGHT'
col.label(text="Glossy")
row = split.row(align=True)
row.use_property_split = False
row.prop(cycles_view_layer, "denoising_glossy_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect", toggle=True)
row = layout.row(align=True)
row.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
row.label(text="Transmission")
split = layout.split(factor=0.5)
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
col = split.column()
col.alignment = 'RIGHT'
col.label(text="Transmission")
row = split.row(align=True)
row.use_property_split = False
row.prop(cycles_view_layer, "denoising_transmission_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect", toggle=True)
row = layout.row(align=True)
row.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
row.label(text="Subsurface")
split = layout.split(factor=0.5)
split.active = cycles_view_layer.use_denoising or cycles_view_layer.denoising_store_passes
col = split.column()
col.alignment = 'RIGHT'
col.label(text="Subsurface")
row = split.row(align=True)
row.use_property_split = False
row.prop(cycles_view_layer, "denoising_subsurface_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_subsurface_indirect", text="Indirect", toggle=True)

@ -47,14 +47,14 @@ class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
rd = context.scene.render
layout.active = rd.use_freestyle
row = layout.row()
row.label(text="Line Thickness:")
row.prop(rd, "line_thickness_mode", expand=True)
layout.prop(rd, "line_thickness_mode", expand=True)
if (rd.line_thickness_mode == 'ABSOLUTE'):
layout.prop(rd, "line_thickness")

@ -48,16 +48,22 @@ class UnifiedPaintPanel:
@staticmethod
def unified_paint_settings(parent, context):
ups = context.tool_settings.unified_paint_settings
parent.label(text="Unified Settings:")
row = parent.row()
row.prop(ups, "use_unified_size", text="Size")
row.prop(ups, "use_unified_strength", text="Strength")
flow = parent.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(ups, "use_unified_size", text="Size")
col = flow.column()
col.prop(ups, "use_unified_strength", text="Strength")
if context.weight_paint_object:
parent.prop(ups, "use_unified_weight", text="Weight")
col = flow.column()
col.prop(ups, "use_unified_weight", text="Weight")
elif context.vertex_paint_object or context.image_paint_object:
parent.prop(ups, "use_unified_color", text="Color")
col = flow.column()
col.prop(ups, "use_unified_color", text="Color")
else:
parent.prop(ups, "use_unified_color", text="Color")
col = flow.column()
col.prop(ups, "use_unified_color", text="Color")
@staticmethod
def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text="", slider=False):
@ -230,14 +236,15 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
def brush_texture_settings(layout, brush, sculpt):
tex_slot = brush.texture_slot
layout.label(text="Brush Mapping:")
layout.use_property_split = True
layout.use_property_decorate = False
# map_mode
if sculpt:
layout.row().prop(tex_slot, "map_mode", text="")
layout.separator()
layout.prop(tex_slot, "map_mode", text="Mapping")
else:
layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
layout.prop(tex_slot, "tex_paint_map_mode", text="Mapping")
layout.separator()
if tex_slot.map_mode == 'STENCIL':
@ -248,8 +255,7 @@ def brush_texture_settings(layout, brush, sculpt):
# angle and texture_angle_source
if tex_slot.has_texture_angle:
col = layout.column()
col.label(text="Angle:")
col.prop(tex_slot, "angle", text="")
col.prop(tex_slot, "angle", text="Angle")
if tex_slot.has_texture_angle_source:
col.prop(tex_slot, "use_rake", text="Rake")
@ -258,32 +264,29 @@ def brush_texture_settings(layout, brush, sculpt):
if brush.sculpt_capabilities.has_random_texture_angle:
col.prop(tex_slot, "use_random", text="Random")
if tex_slot.use_random:
col.prop(tex_slot, "random_angle", text="")
col.prop(tex_slot, "random_angle", text="Raandom Angle")
else:
col.prop(tex_slot, "use_random", text="Random")
if tex_slot.use_random:
col.prop(tex_slot, "random_angle", text="")
col.prop(tex_slot, "random_angle", text="Random Angle")
# scale and offset
split = layout.split()
split.prop(tex_slot, "offset")
split.prop(tex_slot, "scale")
layout.prop(tex_slot, "offset")
layout.prop(tex_slot, "scale")
if sculpt:
# texture_sample_bias
col = layout.column(align=True)
col.label(text="Sample Bias:")
col.prop(brush, "texture_sample_bias", slider=True, text="")
layout.prop(brush, "texture_sample_bias", slider=True, text="Sample Bias")
def brush_mask_texture_settings(layout, brush):
mask_tex_slot = brush.mask_texture_slot
layout.label(text="Mask Mapping:")
layout.use_property_split = True
layout.use_property_decorate = False
# map_mode
layout.row().prop(mask_tex_slot, "mask_map_mode", text="")
layout.separator()
layout.row().prop(mask_tex_slot, "mask_map_mode", text="Mask Mapping")
if mask_tex_slot.map_mode == 'STENCIL':
if brush.mask_texture and brush.mask_texture.type == 'IMAGE':
@ -291,25 +294,22 @@ def brush_mask_texture_settings(layout, brush):
layout.operator("brush.stencil_reset_transform").mask = True
col = layout.column()
col.prop(brush, "use_pressure_masking", text="")
col.prop(brush, "use_pressure_masking", text="Pressure Masking")
# angle and texture_angle_source
if mask_tex_slot.has_texture_angle:
col = layout.column()
col.label(text="Angle:")
col.prop(mask_tex_slot, "angle", text="")
col.prop(mask_tex_slot, "angle", text="Angle")
if mask_tex_slot.has_texture_angle_source:
col.prop(mask_tex_slot, "use_rake", text="Rake")
if brush.brush_capabilities.has_random_texture_angle and mask_tex_slot.has_random_texture_angle:
col.prop(mask_tex_slot, "use_random", text="Random")
if mask_tex_slot.use_random:
col.prop(mask_tex_slot, "random_angle", text="")
col.prop(mask_tex_slot, "random_angle", text="Random Angle")
# scale and offset
split = layout.split()
split.prop(mask_tex_slot, "offset")
split.prop(mask_tex_slot, "scale")
col.prop(mask_tex_slot, "offset")
col.prop(mask_tex_slot, "scale")
classes = (
VIEW3D_MT_tools_projectpaint_clone,

@ -197,11 +197,13 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
rd = context.scene.render
col = layout.column(align=True)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(rd, "use_compositing")
col = flow.column()
col.prop(rd, "use_sequencer")
col.prop(rd, "dither_intensity", text="Dither", slider=True)
layout.prop(rd, "dither_intensity", text="Dither", slider=True)
class RENDER_PT_stamp(RenderButtonsPanel, Panel):
@ -252,11 +254,26 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
col = flow.column()
col.prop(rd, "use_stamp_strip_meta", text="Use Strip Metadata")
row = layout.split(factor=0.3)
row.prop(rd, "use_stamp_note", text="Note")
sub = row.row()
sub.active = rd.use_stamp_note
sub.prop(rd, "stamp_note_text", text="")
class RENDER_PT_stamp_note(RenderButtonsPanel, Panel):
bl_label = "Note"
bl_parent_id = "RENDER_PT_stamp"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
def draw_header(self, context):
rd = context.scene.render
self.layout.prop(rd, "use_stamp_note", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render
layout.active = rd.use_stamp_note
layout.prop(rd, "stamp_note_text", text="")
class RENDER_PT_stamp_burn(RenderButtonsPanel, Panel):
@ -589,12 +606,11 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
layout.active = props.use_gtao
col = layout.column()
col.prop(props, "use_gtao_bent_normals")
col.prop(props, "use_gtao_bounce")
col.prop(props, "gtao_distance")
col.prop(props, "gtao_factor")
col.prop(props, "gtao_quality")
col.prop(props, "use_gtao_bent_normals")
col.prop(props, "use_gtao_bounce")
class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
bl_label = "Motion Blur"
@ -701,25 +717,57 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
props = scene.eevee
layout.active = props.use_volumetric
col = layout.column()
sub = col.column(align=True)
sub.prop(props, "volumetric_start")
sub.prop(props, "volumetric_end")
col.prop(props, "volumetric_tile_size")
col.separator()
col.prop(props, "volumetric_samples")
sub.prop(props, "volumetric_sample_distribution")
col.separator()
col.prop(props, "use_volumetric_lights")
sub = col.column()
sub.active = props.use_volumetric_lights
sub.prop(props, "volumetric_light_clamp", text="Light Clamping")
col.separator()
col.prop(props, "use_volumetric_shadows")
sub = col.column()
sub.active = props.use_volumetric_shadows
sub.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
col = layout.column(align=True)
col.prop(props, "volumetric_start")
col.prop(props, "volumetric_end")
col = layout.column()
col.prop(props, "volumetric_tile_size")
col.prop(props, "volumetric_samples")
col.prop(props, "volumetric_sample_distribution")
class RENDER_PT_eevee_volumetric_lighting(RenderButtonsPanel, Panel):
bl_label = "Volumetric Lighting"
bl_parent_id = "RENDER_PT_eevee_volumetric"
COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw_header(self, context):
scene = context.scene
props = scene.eevee
self.layout.prop(props, "use_volumetric_lights", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
layout.active = props.use_volumetric_lights
layout.prop(props, "volumetric_light_clamp", text="Light Clamping")
class RENDER_PT_eevee_volumetric_shadows(RenderButtonsPanel, Panel):
bl_label = "Volumetric Shadows"
bl_parent_id = "RENDER_PT_eevee_volumetric"
COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw_header(self, context):
scene = context.scene
props = scene.eevee
self.layout.prop(props, "use_volumetric_shadows", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
layout.active = props.use_volumetric_shadows
layout.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
@ -862,28 +910,36 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
col.prop(props, "gi_cubemap_resolution")
col.prop(props, "gi_visibility_resolution", text="Diffuse Occlusion")
layout.use_property_split = False
row = layout.split(factor=0.5)
row.alignment = 'RIGHT'
row.label(text="Cubemap Display")
class RENDER_PT_eevee_indirect_lighting_display(RenderButtonsPanel, Panel):
bl_label = "Display"
bl_parent_id = "RENDER_PT_eevee_indirect_lighting"
COMPAT_ENGINES = {'BLENDER_EEVEE'}
sub = row.row(align=True)
sub.prop(props, "gi_cubemap_display_size", text="Size")
@classmethod
def poll(cls, context):
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
props = scene.eevee
row = layout.row(align=True)
row.prop(props, "gi_cubemap_display_size", text="Cubemap Size")
if props.gi_show_cubemaps:
sub.prop(props, "gi_show_cubemaps", text="", toggle=True, icon='HIDE_OFF')
row.prop(props, "gi_show_cubemaps", text="", toggle=True, icon='HIDE_OFF')
else:
sub.prop(props, "gi_show_cubemaps", text="", toggle=True, icon='HIDE_ON')
row.prop(props, "gi_show_cubemaps", text="", toggle=True, icon='HIDE_ON')
row = layout.split(factor=0.5)
row.alignment = 'RIGHT'
row.label(text="Irradiance Display")
sub = row.row(align=True)
sub.prop(props, "gi_irradiance_display_size", text="Size")
row = layout.row(align=True)
row.prop(props, "gi_irradiance_display_size", text="Irradiance Size")
if props.gi_show_irradiance:
sub.prop(props, "gi_show_irradiance", text="", toggle=True, icon='HIDE_OFF')
row.prop(props, "gi_show_irradiance", text="", toggle=True, icon='HIDE_OFF')
else:
sub.prop(props, "gi_show_irradiance", text="", toggle=True, icon='HIDE_ON')
row.prop(props, "gi_show_irradiance", text="", toggle=True, icon='HIDE_ON')
class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
@ -921,10 +977,9 @@ class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
scene = context.scene
rd = scene.render
row = layout.row()
row.prop(rd, "hair_type", expand=True)
layout.use_property_split = True
layout.prop(rd, "hair_type", expand=True)
layout.prop(rd, "hair_subdiv")
@ -996,6 +1051,7 @@ classes = (
RENDER_PT_encoding_video,
RENDER_PT_encoding_audio,
RENDER_PT_stamp,
RENDER_PT_stamp_note,
RENDER_PT_stamp_burn,
RENDER_UL_renderviews,
RENDER_PT_stereoscopy,
@ -1006,10 +1062,13 @@ classes = (
RENDER_PT_eevee_film,
RENDER_PT_eevee_shadows,
RENDER_PT_eevee_indirect_lighting,
RENDER_PT_eevee_indirect_lighting_display,
RENDER_PT_eevee_subsurface_scattering,
RENDER_PT_eevee_screen_space_reflections,
RENDER_PT_eevee_ambient_occlusion,
RENDER_PT_eevee_volumetric,
RENDER_PT_eevee_volumetric_lighting,
RENDER_PT_eevee_volumetric_shadows,
RENDER_PT_eevee_motion_blur,
RENDER_PT_eevee_depth_of_field,
RENDER_PT_eevee_bloom,

@ -88,6 +88,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
bl_category = "Options"
bl_context = ".mesh_edit" # dot on purpose (access from topbar)
bl_label = "Mesh Options"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
@ -111,11 +112,11 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
row.active = ob.data.use_mirror_x
row.prop(mesh, "use_mirror_topology")
layout.prop(tool_settings, "edge_path_mode")
layout.prop(tool_settings, "edge_path_live_unwrap")
layout.prop(tool_settings, "double_threshold")
layout.prop(tool_settings, "use_mesh_automerge") # , icon='AUTOMERGE_ON'
layout.prop(tool_settings, "use_mesh_automerge")
layout.prop(tool_settings, "double_threshold")
layout.prop(tool_settings, "edge_path_mode")
# ********** default tools for editmode_curve ****************
@ -620,6 +621,8 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = self.paint_settings(context)
brush = settings.brush
@ -628,54 +631,33 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
col = layout.column()
col.label(text="Curve:")
row = col.row(align=True)
row.prop(
brush,
"use_cursor_overlay",
text="",
toggle=True,
icon='RESTRICT_VIEW_OFF' if brush.use_cursor_overlay else 'RESTRICT_VIEW_ON',
)
sub = row.row(align=True)
sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha")
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
row.prop(brush,"use_cursor_overlay", text="", toggle=True, icon='HIDE_ON' if brush.use_cursor_overlay else 'HIDE_OFF')
col.active = brush.brush_capabilities.has_overlay
if context.image_paint_object or context.sculpt_object or context.vertex_paint_object:
col.label(text="Texture:")
row = col.row(align=True)
if tex_slot.map_mode != 'STENCIL':
row.prop(
brush,
"use_primary_overlay",
text="",
toggle=True,
icon='RESTRICT_VIEW_OFF' if brush.use_primary_overlay else 'RESTRICT_VIEW_ON',
)
sub = row.row(align=True)
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
sub.prop(brush, "texture_overlay_alpha", text="Texture Alpha")
sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
if tex_slot.map_mode != 'STENCIL':
row.prop(brush, "use_primary_overlay", text="", toggle=True, icon='HIDE_ON' if brush.use_primary_overlay else 'HIDE_OFF')
if context.image_paint_object:
col.label(text="Mask Texture:")
row = col.row(align=True)
if tex_slot_mask.map_mode != 'STENCIL':
row.prop(
brush,
"use_secondary_overlay",
text="",
toggle=True,
icon='RESTRICT_VIEW_OFF' if brush.use_secondary_overlay else 'RESTRICT_VIEW_ON',
)
sub = row.row(align=True)
sub.prop(brush, "mask_overlay_alpha", text="Alpha")
sub.prop(brush, "mask_overlay_alpha", text="Mask Texture Alpha")
sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
if tex_slot_mask.map_mode != 'STENCIL':
row.prop(brush, "use_secondary_overlay", text="", toggle=True, icon='HIDE_ON' if brush.use_secondary_overlay else 'HIDE_OFF')
# TODO, move to space_view3d.py
@ -755,32 +737,26 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
col.prop(brush, "stroke_method")
if brush.use_anchor:
col.separator()
col.prop(brush, "use_edge_to_edge", text="Edge To Edge")
if brush.use_airbrush:
col.separator()
col.prop(brush, "rate", text="Rate", slider=True)
if brush.use_space:
col.separator()
row = col.row(align=True)
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
if brush.use_line or brush.use_curve:
col.separator()
row = col.row(align=True)
row.prop(brush, "spacing", text="Spacing")
if brush.use_curve:
col.separator()
col.template_ID(brush, "paint_curve", new="paintcurve.new")
col.operator("paintcurve.draw")
if context.sculpt_object:
if brush.sculpt_capabilities.has_jitter:
col.separator()
row = col.row(align=True)
if brush.use_relative_jitter:
@ -790,41 +766,54 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
row.prop(brush, "use_relative_jitter", icon_only=True)
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
if brush.sculpt_capabilities.has_smooth_stroke:
col = layout.column()
col.separator()
col.prop(brush, "use_smooth_stroke")
sub = col.column()
sub.active = brush.use_smooth_stroke
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
else:
col.separator()
row = col.row(align=True)
row.prop(brush, "use_relative_jitter", icon_only=True)
if brush.use_relative_jitter:
row.prop(brush, "jitter", slider=True)
else:
row.prop(brush, "jitter_absolute")
row.prop(brush, "use_relative_jitter", icon_only=True)
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
col = layout.column()
col.separator()
if brush.brush_capabilities.has_smooth_stroke:
col.prop(brush, "use_smooth_stroke")
sub = col.column()
sub.active = brush.use_smooth_stroke
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
layout.prop(settings, "input_samples")
class VIEW3D_PT_tools_brush_stroke_smooth_stroke(Panel, View3DPaintPanel):
bl_context = ".paint_common" # dot on purpose (access from topbar)
bl_label = "Smooth Stroke"
bl_parent_id = "VIEW3D_PT_tools_brush_stroke"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
settings = cls.paint_settings(context)
brush = settings.brush
if brush.brush_capabilities.has_smooth_stroke:
return True
def draw_header(self, context):
settings = self.paint_settings(context)
brush = settings.brush
self.layout.prop(brush, "use_smooth_stroke", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = self.paint_settings(context)
brush = settings.brush
col = layout.column()
col.active = brush.use_smooth_stroke
col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
# TODO, move to space_view3d.py
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
bl_context = ".paint_common" # dot on purpose (access from topbar)
@ -904,15 +893,37 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
col.prop(sculpt, "use_smooth_shading")
col.separator()
class VIEW3D_PT_sculpt_dyntopo_remesh(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
bl_label = "Remesh"
bl_parent_id = "VIEW3D_PT_sculpt_dyntopo"
bl_options = {'DEFAULT_CLOSED'}
bl_ui_units_x = 12
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
col = layout.column()
col.active = context.sculpt_object.use_dynamic_topology_sculpting
col.prop(sculpt, "symmetrize_direction")
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.operator("sculpt.symmetrize")
col = flow.column()
col.operator("sculpt.optimize")
if sculpt.detail_type_method in {'CONSTANT', 'MANUAL'}:
col = flow.column()
col.operator("sculpt.detail_flood_fill")
# TODO, move to space_view3d.py
class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
@ -925,25 +936,64 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(sculpt, "use_threaded", text="Threaded Sculpt")
col = flow.column()
col.prop(sculpt, "show_low_resolution")
col = flow.column()
col.prop(sculpt, "use_deform_only")
col = flow.column()
col.prop(sculpt, "show_diffuse_color")
col = flow.column()
col.prop(sculpt, "show_mask")
class VIEW3D_PT_sculpt_options_unified(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
bl_parent_id = "VIEW3D_PT_sculpt_options"
bl_label = "Unified Brush"
@classmethod
def poll(cls, context):
return (context.sculpt_object and context.tool_settings.sculpt)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
self.unified_paint_settings(layout, context)
class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
bl_parent_id = "VIEW3D_PT_sculpt_options"
bl_label = "Gravity"
@classmethod
def poll(cls, context):
return (context.sculpt_object and context.tool_settings.sculpt)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
capabilities = sculpt.brush.sculpt_capabilities
col = layout.column(align=True)
col = layout.column()
col.active = capabilities.has_gravity
col.label(text="Gravity:")
col.prop(sculpt, "gravity", slider=True, text="Factor")
col.prop(sculpt, "gravity_object")
col.separator()
layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
layout.prop(sculpt, "show_low_resolution")
layout.prop(sculpt, "use_deform_only")
layout.prop(sculpt, "show_diffuse_color")
layout.prop(sculpt, "show_mask")
self.unified_paint_settings(layout, context)
# TODO, move to space_view3d.py
@ -1023,35 +1073,68 @@ class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
def draw(self, context):
layout = self.layout
settings = self.paint_settings(context)
brush = settings.brush
if brush is None: # unlikely but can happen
layout.label(text="Brush Unset")
return
col = layout.column()
col.prop(settings, "show_brush")
sub = col.column()
sub.active = settings.show_brush
class VIEW3D_PT_tools_brush_appearance_show_brush(Panel, View3DPaintPanel):
bl_context = ".paint_common" # dot on purpose (access from topbar)
bl_label = "Show Brush"
bl_parent_id = "VIEW3D_PT_tools_brush_appearance"
bl_options = {'DEFAULT_CLOSED'}
def draw_header(self, context):
settings = self.paint_settings(context)
self.layout.prop(settings, "show_brush", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = self.paint_settings(context)
brush = settings.brush
col = layout.column()
col.active = settings.show_brush
if context.sculpt_object and context.tool_settings.sculpt:
if brush.sculpt_capabilities.has_secondary_color:
sub.row().prop(brush, "cursor_color_add", text="Add")
sub.row().prop(brush, "cursor_color_subtract", text="Subtract")
col.prop(brush, "cursor_color_add", text="Add")
col.prop(brush, "cursor_color_subtract", text="Subtract")
else:
sub.prop(brush, "cursor_color_add", text="")
col.prop(brush, "cursor_color_add", text="Color")
else:
sub.prop(brush, "cursor_color_add", text="")
col.prop(brush, "cursor_color_add", text="Color")
col.separator()
col = col.column(align=True)
col.prop(brush, "use_custom_icon")
sub = col.column()
sub.active = brush.use_custom_icon
sub.prop(brush, "icon_filepath", text="")
class VIEW3D_PT_tools_brush_appearance_custom_icon(Panel, View3DPaintPanel):
bl_context = ".paint_common" # dot on purpose (access from topbar)
bl_label = "Custom Icon"
bl_parent_id = "VIEW3D_PT_tools_brush_appearance"
bl_options = {'DEFAULT_CLOSED'}
def draw_header(self, context):
settings = self.paint_settings(context)
brush = settings.brush
self.layout.prop(brush, "use_custom_icon", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
settings = self.paint_settings(context)
brush = settings.brush
col = layout.column()
col.active = brush.use_custom_icon
col.prop(brush, "icon_filepath", text="")
# ********** default tools for weight-paint ****************
@ -1133,17 +1216,22 @@ class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
col = layout.column()
row = col.split(factor=0.55, align=True)
row.operator("image.project_edit", text="Quick Edit")
row.operator("image.project_apply", text="Apply")
layout.prop(ipaint, "screen_grab_size", text="Screen Grab Size")
col.row().prop(ipaint, "screen_grab_size", text="")
layout.separator()
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.operator("image.project_edit", text="Quick Edit")
col = flow.column()
col.operator("image.project_apply", text="Apply")
col = flow.column()
col.operator("paint.project_image", text="Apply Camera Image")
@ -1187,14 +1275,12 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
col = layout.column()
col.prop(ipaint, "use_occlude")
col.prop(ipaint, "use_backface_culling")
row = layout.row()
row.prop(ipaint, "use_normal_falloff")
@ -1202,14 +1288,51 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
sub.active = (ipaint.use_normal_falloff)
sub.prop(ipaint, "normal_angle", text="")
layout.prop(ipaint, "use_cavity")
if ipaint.use_cavity:
layout.template_curve_mapping(ipaint, "cavity_curve", brush=True)
layout.prop(ipaint, "seam_bleed")
layout.prop(ipaint, "dither")
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(ipaint, "use_occlude")
col = flow.column()
col.prop(ipaint, "use_backface_culling")
class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel):
bl_context = ".imagepaint" # dot on purpose (access from topbar)
bl_parent_id = "VIEW3D_PT_tools_projectpaint"
bl_label = "Unified Brush"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
self.unified_paint_settings(layout, context)
class VIEW3D_PT_tools_projectpaint_cavity(View3DPaintPanel, Panel):
bl_context = ".imagepaint" # dot on purpose (access from topbar)
bl_label = "Cavity Mask"
bl_parent_id = "VIEW3D_PT_tools_projectpaint"
bl_options = {'DEFAULT_CLOSED'}
def draw_header(self, context):
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
self.layout.prop(ipaint, "use_cavity", text="")
def draw(self, context):
layout = self.layout
toolsettings = context.tool_settings
ipaint = toolsettings.image_paint
layout.active = ipaint.use_cavity
layout.template_curve_mapping(ipaint, "cavity_curve", brush=True)
# TODO, move to space_view3d.py
class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
@ -1312,22 +1435,18 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
class VIEW3D_PT_tools_normal(View3DPanel, Panel):
bl_category = ""
bl_context = ".mesh_edit"
bl_label = "Normal Tools"
bl_label = "Normals"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
toolsettings = context.tool_settings
col = layout.column(align=True)
col.label(text="Normal Vector")
col.prop(toolsettings, "normal_vector", text="")
layout.separator()
layout.label(text="Face Strength")
layout.prop(toolsettings, "face_strength", text="")
col = layout.column(align=True)
layout.prop(toolsettings, "normal_vector", text="Normal Vector")
layout.prop(toolsettings, "face_strength", text="Face Strength")
# ********** grease pencil object tool panels ****************
@ -1752,11 +1871,17 @@ classes = (
VIEW3D_PT_tools_brush_texture,
VIEW3D_PT_tools_mask_texture,
VIEW3D_PT_tools_brush_stroke,
VIEW3D_PT_tools_brush_stroke_smooth_stroke,
VIEW3D_PT_tools_brush_curve,
VIEW3D_PT_sculpt_dyntopo,
VIEW3D_PT_sculpt_dyntopo_remesh,
VIEW3D_PT_sculpt_options,
VIEW3D_PT_sculpt_options_unified,
VIEW3D_PT_sculpt_options_gravity,
VIEW3D_PT_sculpt_symmetry,
VIEW3D_PT_tools_brush_appearance,
VIEW3D_PT_tools_brush_appearance_show_brush,
VIEW3D_PT_tools_brush_appearance_custom_icon,
VIEW3D_PT_tools_weightpaint_symmetry,
VIEW3D_PT_tools_weightpaint_options,
VIEW3D_PT_tools_vertexpaint,
@ -1764,6 +1889,8 @@ classes = (
VIEW3D_PT_tools_imagepaint_external,
VIEW3D_PT_tools_imagepaint_symmetry,
VIEW3D_PT_tools_projectpaint,
VIEW3D_PT_tools_projectpaint_unified,
VIEW3D_PT_tools_projectpaint_cavity,
VIEW3D_MT_tools_projectpaint_stencil,
VIEW3D_PT_tools_particlemode,