[Bf-blender-cvs] [7c77bc9a54c] gpencil-new-data-proposal: Rename CurveGeometry getter in new gpencil structure

Amelie Fondevilla noreply at git.blender.org
Tue Dec 20 15:53:47 CET 2022


Commit: 7c77bc9a54c1eeb27646adffb6847497f37ef396
Author: Amelie Fondevilla
Date:   Tue Dec 20 15:53:05 2022 +0100
Branches: gpencil-new-data-proposal
https://developer.blender.org/rB7c77bc9a54c1eeb27646adffb6847497f37ef396

Rename CurveGeometry getter in new gpencil structure

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

M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	source/blender/blenkernel/intern/gpencil_new_proposal.cc
M	source/blender/blenkernel/intern/gpencil_new_proposal.hh
M	source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc
M	source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 4a581c54af9..6514c6647d4 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 4a581c54af9b92cb670d750951b9382160f10f3e
+Subproject commit 6514c6647d4019971c54c436cd2288a9f84c7b28
diff --git a/release/scripts/addons b/release/scripts/addons
index 0b0052bd53a..5ba2c7517e8 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 0b0052bd53ad8249ed07dfb87705c338af698bde
+Subproject commit 5ba2c7517e8577e3cfe1dcb2e29a4627842e2aea
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 96143b1a8b0..bdcfdd47ec3 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 96143b1a8b037ea3c81f065f557025db9fe1ace3
+Subproject commit bdcfdd47ec3451822b21d1cff2ea2db751093c9a
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal.cc b/source/blender/blenkernel/intern/gpencil_new_proposal.cc
index c3d6ada6071..3a9767f253d 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal.cc
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal.cc
@@ -164,7 +164,7 @@ bool GPFrame::operator==(const GPFrame &other) const
   return this->layer_index == other.layer_index && this->start_time == other.start_time;
 }
 
-CurvesGeometry &GPFrame::strokes_as_curves()
+CurvesGeometry &GPFrame::curves()
 {
   if (!this->strokes) {
     this->strokes = MEM_new<CurvesGeometry>(__func__);
@@ -172,7 +172,7 @@ CurvesGeometry &GPFrame::strokes_as_curves()
   return CurvesGeometry::wrap(*this->strokes);
 }
 
-const CurvesGeometry &GPFrame::strokes_as_curves() const
+const CurvesGeometry &GPFrame::curves() const
 {
   BLI_assert(this->strokes != nullptr);
   return CurvesGeometry::wrap(*this->strokes);
@@ -201,7 +201,7 @@ int GPFrame::points_num() const
 
 IndexRange GPFrame::add_new_stroke(int new_points_num)
 {
-  CurvesGeometry &strokes = this->strokes_as_curves();
+  CurvesGeometry &strokes = this->curves();
   int orig_last_offset = strokes.offsets().last();
 
   strokes.resize(strokes.points_num() + new_points_num, strokes.curves_num() + 1);
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal.hh b/source/blender/blenkernel/intern/gpencil_new_proposal.hh
index 461de5c8041..c61948c5175 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal.hh
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal.hh
@@ -258,8 +258,8 @@ class GPFrame : public ::GPFrame {
 
   bool operator==(const GPFrame &other) const;
 
-  CurvesGeometry &strokes_as_curves();
-  const CurvesGeometry &strokes_as_curves() const;
+  CurvesGeometry &curves();
+  const CurvesGeometry &curves() const;
 
   bool is_empty() const;
   int strokes_num() const;
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc b/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc
index 7e155b57f72..a076c49b1ce 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal_conversion.cc
@@ -27,7 +27,7 @@ GPData convert_old_to_new_gpencil_data(bGPdata *old_gpd)
         offsets.append(old_gps->totpoints + offsets.last());
       }
 
-      CurvesGeometry &new_gps{new_gpf.strokes_as_curves()};
+      CurvesGeometry &new_gps{new_gpf.curves()};
       MutableAttributeAccessor attributes = new_gps.attributes_for_write();
       new_gps.resize(offsets.last(), offsets.size() - 1);
       new_gps.offsets_for_write().copy_from(offsets);
@@ -81,11 +81,12 @@ bGPdata *convert_new_to_old_gpencil_data(const GPData &new_gpd)
       old_gpf->framenum = new_gpf.start_time;
 
       BLI_listbase_clear(&old_gpf->strokes);
-      const CurvesGeometry &new_gps{new_gpf.strokes_as_curves()};
+      const CurvesGeometry &new_gps{new_gpf.curves()};
       AttributeAccessor attributes = new_gps.attributes();
 
       Span<float3> new_gps_positions = new_gps.positions();
-      VArray<float> new_gps_radii = attributes.lookup_or_default<float>(ATTR_RADIUS, ATTR_DOMAIN_POINT, 0);
+      VArray<float> new_gps_radii = attributes.lookup_or_default<float>(
+          ATTR_RADIUS, ATTR_DOMAIN_POINT, 0);
 
       for (int stroke_index = 0; stroke_index < new_gpf.strokes_num(); stroke_index++) {
         bGPDstroke *old_gps = reinterpret_cast<bGPDstroke *>(
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc b/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
index ce35caecf8b..f6716d669de 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
@@ -38,7 +38,7 @@ static GPData build_gpencil_data(int num_layers,
   }
 
   for (const int frame_i : gpd.frames().index_range()) {
-    CurvesGeometry &strokes = gpd.frames_for_write(frame_i).strokes_as_curves();
+    CurvesGeometry &strokes = gpd.frames_for_write(frame_i).curves();
     strokes.resize(points_per_stroke * strokes_per_frame, strokes_per_frame);
     strokes.offsets_for_write().drop_back(1).fill(points_per_stroke);
     curves::accumulate_counts_to_offsets(strokes.offsets_for_write());
@@ -157,7 +157,7 @@ static void insert_new_stroke_new_gpencil_data(GPFrame &gpf,
 {
   int stroke_index{gpf.strokes_num()};
   gpf.add_new_stroke(point_num);
-  CurvesGeometry &curves = gpf.strokes_as_curves();
+  CurvesGeometry &curves = gpf.curves();
   MutableAttributeAccessor attributes = curves.attributes_for_write();
 
   int point_index{0};
@@ -245,7 +245,7 @@ static void compare_gpencil_data_structures(const GPData &new_gpd, const bGPdata
         }
 
         // Compare stroke data
-        compare_gpencil_stroke_data(new_gpf.strokes_as_curves(), curve_index, stk);
+        compare_gpencil_stroke_data(new_gpf.curves(), curve_index, stk);
 
         ++curve_index;
       }
@@ -434,7 +434,7 @@ TEST(gpencil_proposal, ChangeStrokePoints)
   const int frame_index = data.add_frame_on_layer(layer1_index, 0);
   EXPECT_NE(frame_index, -1);
 
-  CurvesGeometry &curves = data.frames_for_write(frame_index).strokes_as_curves();
+  CurvesGeometry &curves = data.frames_for_write(frame_index).curves();
   curves.resize(curves.points_num() + test_positions.size(), curves.curves_num() + 1);
   curves.offsets_for_write().last() = curves.offsets().last(1) + test_positions.size();
 
@@ -531,7 +531,7 @@ TEST(gpencil_proposal, TimeMultiFrameTransformStrokes)
     SCOPED_TIMER("TimeMultiFrameTransformStrokes");
     for (const int i : data.frames_on_active_layer()) {
       GPFrame &gpf = data.frames_for_write(i);
-      CurvesGeometry &curves = gpf.strokes_as_curves();
+      CurvesGeometry &curves = gpf.curves();
       curves.transform(translate_mat);
     }
   }
diff --git a/source/tools b/source/tools
index fdfa2fcb949..a28f09834ae 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit fdfa2fcb9495d87571f2dfe2ae9fa0e032536600
+Subproject commit a28f09834aeb4c0adabcce4feff9a2d62b3d58da



More information about the Bf-blender-cvs mailing list