[Bf-blender-cvs] [ddccb5411df] sculpt-mode-features: Set pivot position: update to new sculpt API

Pablo Dobarro noreply at git.blender.org
Tue Aug 6 16:47:56 CEST 2019


Commit: ddccb5411df0705474bc5f11f339460f20d86eb4
Author: Pablo Dobarro
Date:   Tue Aug 6 16:48:29 2019 +0200
Branches: sculpt-mode-features
https://developer.blender.org/rBddccb5411df0705474bc5f11f339460f20d86eb4

Set pivot position: update to new sculpt API

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

M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index a6300b8fc6f..ce195373f28 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -9517,11 +9517,11 @@ static int sculpt_set_pivot_position_invoke(bContext *C, wmOperator *op, const w
     float avg[3];
     int total = 0;
     zero_v3(avg);
-    for (int i = 0; i < ss->totvert; i++) {
-      if (ss->vmask[i] < 1.0f &&
-          check_vertex_pivot_symmetry(ss->mvert[i].co, ss->pivot_pos, symm)) {
+    for (int i = 0; i < sculpt_vertex_count_get(ss); i++) {
+      if (sculpt_vertex_mask_get(ss, i) < 1.0f &&
+          check_vertex_pivot_symmetry(sculpt_vertex_co_get(ss, i), ss->pivot_pos, symm)) {
         total++;
-        add_v3_v3(avg, ss->mvert[i].co);
+        add_v3_v3(avg, sculpt_vertex_co_get(ss, i));
       }
     }
     if (total > 0) {
@@ -9536,11 +9536,12 @@ static int sculpt_set_pivot_position_invoke(bContext *C, wmOperator *op, const w
     int total = 0;
     float threshold = 0.2f;
     zero_v3(avg);
-    for (int i = 0; i < ss->totvert; i++) {
-      if (ss->vmask[i] < (0.5f + threshold) && ss->vmask[i] > (0.5f - threshold) &&
-          check_vertex_pivot_symmetry(ss->mvert[i].co, ss->pivot_pos, symm)) {
+    for (int i = 0; i < sculpt_vertex_count_get(ss); i++) {
+      if (sculpt_vertex_mask_get(ss, i) < (0.5f + threshold) &&
+          sculpt_vertex_mask_get(ss, i) > (0.5f - threshold) &&
+          check_vertex_pivot_symmetry(sculpt_vertex_co_get(ss, i), ss->pivot_pos, symm)) {
         total++;
-        add_v3_v3(avg, ss->mvert[i].co);
+        add_v3_v3(avg, sculpt_vertex_co_get(ss, i));
       }
     }
     if (total > 0) {
@@ -9551,7 +9552,7 @@ static int sculpt_set_pivot_position_invoke(bContext *C, wmOperator *op, const w
 
   /* pivot to active vertex */
   if (mode == SCULPT_PIVOT_POSITION_ACTIVE_VERTEX) {
-    copy_v3_v3(ss->pivot_pos, ss->mvert[ss->active_vertex_mesh_index].co);
+    copy_v3_v3(ss->pivot_pos, sculpt_vertex_co_get(ss, sculpt_active_vertex_get(ss)));
   }
 
   /* pivot to raycast surface */



More information about the Bf-blender-cvs mailing list