Sculpt: Add option to show the sculpt pivot as part of the cursor

This commit is contained in:
Pablo Dobarro 2021-02-14 18:17:29 +01:00
parent edece9e741
commit ccfc8aacf8
4 changed files with 18 additions and 0 deletions

View File

@ -849,6 +849,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
col.prop(sculpt, "show_low_resolution")
col.prop(sculpt, "use_sculpt_delay_updates")
col.prop(sculpt, "use_deform_only")
col.prop(sculpt, "show_sculpt_pivot")
col.separator()

View File

@ -1636,6 +1636,16 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *
2);
}
/* Transform Pivot. */
if (pcontext->paint && pcontext->paint->flags & PAINT_SCULPT_SHOW_PIVOT) {
cursor_draw_point_screen_space(
pcontext->pos,
pcontext->region,
pcontext->ss->pivot_pos,
pcontext->vc.obact->obmat,
2);
}
if (brush->sculpt_tool == SCULPT_TOOL_BOUNDARY) {
paint_cursor_preview_boundary_data_update(pcontext, update_previews);
paint_cursor_preview_boundary_data_pivot_draw(pcontext);

View File

@ -2178,6 +2178,7 @@ typedef enum ePaintFlags {
PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
PAINT_USE_CAVITY_MASK = (1 << 3),
PAINT_SCULPT_DELAY_UPDATES = (1 << 4),
PAINT_SCULPT_SHOW_PIVOT = (1 << 5),
} ePaintFlags;
/**

View File

@ -618,6 +618,12 @@ static void rna_def_paint(BlenderRNA *brna)
prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "show_sculpt_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SCULPT_SHOW_PIVOT);
RNA_def_property_ui_text(
prop, "Show Pivot", "Show Transform Tool Sculpt Pivot");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SCULPT_DELAY_UPDATES);
RNA_def_property_ui_text(