[Bf-blender-cvs] [76d7e3a0cc9] virtual-array-attributes: rename apply to save

Jacques Lucke noreply at git.blender.org
Sat Apr 17 14:25:49 CEST 2021


Commit: 76d7e3a0cc96b219dcc7a80f9c7fa75313e9b316
Author: Jacques Lucke
Date:   Fri Apr 16 15:03:41 2021 +0200
Branches: virtual-array-attributes
https://developer.blender.org/rB76d7e3a0cc96b219dcc7a80f9c7fa75313e9b316

rename apply to save

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

M	source/blender/blenkernel/intern/attribute_access.cc
M	source/blender/blenkernel/intern/geometry_set_instances.cc
M	source/blender/blenlib/BLI_virtual_array.hh
M	source/blender/functions/FN_generic_virtual_array.hh
M	source/blender/functions/intern/generic_virtual_array.cc
M	source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc

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

diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index d013fb4e060..4c0c325b8c4 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -185,7 +185,7 @@ AttributeDomain attribute_domain_highest_priority(Span<AttributeDomain> domains)
 void OutputAttribute::save()
 {
   if (optional_span_varray_.has_value()) {
-    optional_span_varray_->apply();
+    optional_span_varray_->save();
   }
   if (save_) {
     save_(*this);
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc
index aaea5e14cbe..d4a4c2539ea 100644
--- a/source/blender/blenkernel/intern/geometry_set_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_set_instances.cc
@@ -487,7 +487,7 @@ static void join_attributes(Span<GeometryInstanceGroup> set_groups,
       }
     }
 
-    dst_span.apply();
+    dst_span.save();
   }
 }
 
diff --git a/source/blender/blenlib/BLI_virtual_array.hh b/source/blender/blenlib/BLI_virtual_array.hh
index ab71a70bd5f..615e1dd9b35 100644
--- a/source/blender/blenlib/BLI_virtual_array.hh
+++ b/source/blender/blenlib/BLI_virtual_array.hh
@@ -409,8 +409,8 @@ template<typename T> class VMutableArray_Span final : public MutableSpan<T> {
  private:
   VMutableArray<T> &varray_;
   Array<T> owned_data_;
-  bool apply_has_been_called_ = false;
-  bool show_not_applied_warning_ = true;
+  bool save_has_been_called_ = false;
+  bool show_not_saved_warning_ = true;
 
  public:
   VMutableArray_Span(VMutableArray<T> &varray, const bool materialize = true)
@@ -435,16 +435,16 @@ template<typename T> class VMutableArray_Span final : public MutableSpan<T> {
 
   ~VMutableArray_Span()
   {
-    if (show_not_applied_warning_) {
-      if (!apply_has_been_called_) {
-        std::cout << "Warning: Call `apply()` to make sure that changes persist in all cases.\n";
+    if (show_not_saved_warning_) {
+      if (!save_has_been_called_) {
+        std::cout << "Warning: Call `save()` to make sure that changes persist in all cases.\n";
       }
     }
   }
 
-  void apply()
+  void save()
   {
-    apply_has_been_called_ = true;
+    save_has_been_called_ = true;
     if (this->data_ != owned_data_.data()) {
       return;
     }
@@ -453,7 +453,7 @@ template<typename T> class VMutableArray_Span final : public MutableSpan<T> {
 
   void disable_not_applied_warning()
   {
-    show_not_applied_warning_ = false;
+    show_not_saved_warning_ = false;
   }
 };
 
diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh
index ea6d79cf16d..1c2101a3660 100644
--- a/source/blender/functions/FN_generic_virtual_array.hh
+++ b/source/blender/functions/FN_generic_virtual_array.hh
@@ -542,14 +542,14 @@ class GVMutableArray_GSpan : public GMutableSpan {
  private:
   GVMutableArray &varray_;
   void *owned_data_ = nullptr;
-  bool apply_has_been_called_ = false;
-  bool show_not_applied_warning_ = true;
+  bool save_has_been_called_ = false;
+  bool show_not_saved_warning_ = true;
 
  public:
   GVMutableArray_GSpan(GVMutableArray &varray, bool materialize = true);
   ~GVMutableArray_GSpan();
 
-  void apply();
+  void save();
   void disable_not_applied_warning();
 };
 
diff --git a/source/blender/functions/intern/generic_virtual_array.cc b/source/blender/functions/intern/generic_virtual_array.cc
index d2ff8ac0783..587f167dfd4 100644
--- a/source/blender/functions/intern/generic_virtual_array.cc
+++ b/source/blender/functions/intern/generic_virtual_array.cc
@@ -266,8 +266,8 @@ GVMutableArray_GSpan::GVMutableArray_GSpan(GVMutableArray &varray, const bool ma
 
 GVMutableArray_GSpan::~GVMutableArray_GSpan()
 {
-  if (show_not_applied_warning_) {
-    if (!apply_has_been_called_) {
+  if (show_not_saved_warning_) {
+    if (!save_has_been_called_) {
       std::cout << "Warning: Call `apply()` to make sure that changes persist in all cases.\n";
     }
   }
@@ -277,9 +277,9 @@ GVMutableArray_GSpan::~GVMutableArray_GSpan()
   }
 }
 
-void GVMutableArray_GSpan::apply()
+void GVMutableArray_GSpan::save()
 {
-  apply_has_been_called_ = true;
+  save_has_been_called_ = true;
   if (data_ != owned_data_) {
     return;
   }
@@ -291,7 +291,7 @@ void GVMutableArray_GSpan::apply()
 
 void GVMutableArray_GSpan::disable_not_applied_warning()
 {
-  show_not_applied_warning_ = false;
+  show_not_saved_warning_ = false;
 }
 
 }  // namespace blender::fn
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
index e4832c320c5..364188dbf03 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_vector_math.cc
@@ -189,7 +189,7 @@ static void do_math_operation_fl3_fl3_to_fl3(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);
@@ -220,7 +220,7 @@ static void do_math_operation_fl3_fl3_fl3_to_fl3(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);
@@ -251,7 +251,7 @@ static void do_math_operation_fl3_fl3_fl_to_fl3(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);
@@ -279,7 +279,7 @@ static void do_math_operation_fl3_fl3_to_fl(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);
@@ -307,7 +307,7 @@ static void do_math_operation_fl3_fl_to_fl3(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);
@@ -332,7 +332,7 @@ static void do_math_operation_fl3_to_fl3(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);
@@ -357,7 +357,7 @@ static void do_math_operation_fl3_to_fl(const VArray<float3> &input_a,
         }
       });
 
-  span_result.apply();
+  span_result.save();
 
   /* The operation is not supported by this node currently. */
   BLI_assert(success);



More information about the Bf-blender-cvs mailing list