UI: add Proportional Size to Proportional Edit popover

Rather than forcing the user to initiate a transform operation to edit the `Proportional Size`, allow editing of the `Proportional Size` through the UI.

The affected headers are:
- View 3D
- Dop Sheet
- Image Editor
- Graph Editor
- Mask Editor

Pull Request: https://projects.blender.org/blender/blender/pulls/107507
This commit is contained in:
Germano Cavalcante 2023-05-04 16:39:22 +02:00
parent 239c1194a0
commit 6b5b777ca3
6 changed files with 81 additions and 4 deletions

@ -230,7 +230,13 @@ class CLIP_HT_header(Header):
row.prop(tool_settings, "use_proportional_edit_mask", text="", icon_only=True)
sub = row.row(align=True)
sub.active = tool_settings.use_proportional_edit_mask
sub.prop(tool_settings, "proportional_edit_falloff", text="", icon_only=True)
sub.prop_with_popover(
tool_settings,
"proportional_edit_falloff",
text="",
icon_only=True,
panel="CLIP_PT_proportional_edit",
)
row = layout.row()
row.template_ID(sc, "mask", new="mask.new")
@ -262,6 +268,22 @@ class CLIP_HT_header(Header):
sub.popover(panel="CLIP_PT_gizmo_display", text="")
class CLIP_PT_proportional_edit(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Proportional Editing"
bl_ui_units_x = 8
def draw(self, context):
layout = self.layout
tool_settings = context.tool_settings
col = layout.column()
col.active = tool_settings.use_proportional_edit_mask
col.prop(tool_settings, "proportional_edit_falloff", expand=True)
col.prop(tool_settings, "proportional_size")
class CLIP_MT_tracking_editor_menus(Menu):
bl_idname = "CLIP_MT_tracking_editor_menus"
bl_label = ""
@ -1928,6 +1950,7 @@ class CLIP_PT_gizmo_display(Panel):
classes = (
CLIP_UL_tracking_objects,
CLIP_PT_proportional_edit,
CLIP_HT_header,
CLIP_PT_display,
CLIP_PT_clip_display,

@ -281,7 +281,29 @@ class DOPESHEET_HT_editor_buttons:
row.prop(tool_settings, "use_proportional_action", text="", icon_only=True)
sub = row.row(align=True)
sub.active = tool_settings.use_proportional_action
sub.prop(tool_settings, "proportional_edit_falloff", text="", icon_only=True)
sub.prop_with_popover(
tool_settings,
"proportional_edit_falloff",
text="",
icon_only=True,
panel="DOPESHEET_PT_proportional_edit",
)
class DOPESHEET_PT_proportional_edit(Panel):
bl_space_type = 'DOPESHEET_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Proportional Editing"
bl_ui_units_x = 8
def draw(self, context):
layout = self.layout
tool_settings = context.tool_settings
col = layout.column()
col.active = tool_settings.use_proportional_action
col.prop(tool_settings, "proportional_edit_falloff", expand=True)
col.prop(tool_settings, "proportional_size")
class DOPESHEET_MT_editor_menus(Menu):
@ -822,6 +844,7 @@ class DOPESHEET_PT_gpencil_layer_display(LayersDopeSheetPanel, GreasePencilLayer
classes = (
DOPESHEET_HT_header,
DOPESHEET_PT_proportional_edit,
DOPESHEET_MT_editor_menus,
DOPESHEET_MT_view,
DOPESHEET_MT_select,

@ -53,7 +53,29 @@ class GRAPH_HT_header(Header):
row.prop(tool_settings, "use_proportional_fcurve", text="", icon_only=True)
sub = row.row(align=True)
sub.active = tool_settings.use_proportional_fcurve
sub.prop(tool_settings, "proportional_edit_falloff", text="", icon_only=True)
sub.prop_with_popover(
tool_settings,
"proportional_edit_falloff",
text="",
icon_only=True,
panel="GRAPH_PT_proportional_edit",
)
class GRAPH_PT_proportional_edit(Panel):
bl_space_type = 'GRAPH_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Proportional Editing"
bl_ui_units_x = 8
def draw(self, context):
layout = self.layout
tool_settings = context.tool_settings
col = layout.column()
col.active = tool_settings.use_proportional_fcurve
col.prop(tool_settings, "proportional_edit_falloff", expand=True)
col.prop(tool_settings, "proportional_size")
class GRAPH_PT_filters(DopesheetFilterPopoverBase, Panel):
@ -492,6 +514,7 @@ class GRAPH_MT_channel_context_menu(Menu):
classes = (
GRAPH_HT_header,
GRAPH_PT_proportional_edit,
GRAPH_MT_editor_menus,
GRAPH_MT_view,
GRAPH_MT_select,

@ -1001,6 +1001,7 @@ class IMAGE_PT_proportional_edit(Panel):
col.separator()
col.prop(tool_settings, "proportional_edit_falloff", expand=True)
col.prop(tool_settings, "proportional_size")
class IMAGE_PT_image_properties(Panel):

@ -7105,6 +7105,7 @@ class VIEW3D_PT_proportional_edit(Panel):
col.separator()
col.prop(tool_settings, "proportional_edit_falloff", expand=True)
col.prop(tool_settings, "proportional_distance")
class VIEW3D_PT_transform_orientations(Panel):

@ -3236,7 +3236,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE_LEGACY);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "proportional_size");
RNA_def_property_ui_text(
prop, "Proportional Size", "Display size for proportional editing circle");
RNA_def_property_range(prop, 0.00001, 5000.0);
prop = RNA_def_property(srna, "proportional_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "proportional_size");
RNA_def_property_ui_text(
prop, "Proportional Size", "Display size for proportional editing circle");