[Bf-blender-cvs] [ccfc8aacf8f] sculpt-dev: Sculpt: Add option to show the sculpt pivot as part of the cursor

Pablo Dobarro noreply at git.blender.org
Sun Feb 14 20:02:51 CET 2021


Commit: ccfc8aacf8fd5bd377acfdc49391d508de4961f4
Author: Pablo Dobarro
Date:   Sun Feb 14 18:17:29 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rBccfc8aacf8fd5bd377acfdc49391d508de4961f4

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

===================================================================

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_sculpt_paint.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index f93a6f3346b..a2a71ce8965 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -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()
 
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 3e6610f5703..6c22f96e8ea 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -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);
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 5063ab90c45..89da632dfa9 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -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;
 
 /**
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 60456df38d8..c33df5cc987 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -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(



More information about the Bf-blender-cvs mailing list