[Bf-blender-cvs] [cff359cdff8] virtual-array-attributes: cleanup

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


Commit: cff359cdff8e261f5966e92e47d5d1ebe3f29ff4
Author: Jacques Lucke
Date:   Fri Apr 16 15:27:06 2021 +0200
Branches: virtual-array-attributes
https://developer.blender.org/rBcff359cdff8e261f5966e92e47d5d1ebe3f29ff4

cleanup

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

M	source/blender/nodes/NOD_geometry_exec.hh
M	source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
M	source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
M	source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
M	source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc

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

diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index 710552d25e2..2ad312d246f 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -42,7 +42,9 @@ using bke::ReadAttributeLookup;
 using bke::WriteAttributeLookup;
 using fn::CPPType;
 using fn::GMutablePointer;
+using fn::GMutableSpan;
 using fn::GPointer;
+using fn::GSpan;
 using fn::GValueMap;
 using fn::GVArray;
 using fn::GVArray_GSpan;
@@ -219,15 +221,15 @@ class GeoNodeExecParams {
                                                const void *default_value) const;
 
   template<typename T>
-  fn::GVArray_Typed<T> get_input_attribute(const StringRef name,
-                                           const GeometryComponent &component,
-                                           const AttributeDomain domain,
-                                           const T &default_value) const
+  GVArray_Typed<T> get_input_attribute(const StringRef name,
+                                       const GeometryComponent &component,
+                                       const AttributeDomain domain,
+                                       const T &default_value) const
   {
     const CustomDataType type = bke::cpp_type_to_custom_data_type(CPPType::get<T>());
     std::unique_ptr<GVArray> varray = this->get_input_attribute(
         name, component, domain, type, &default_value);
-    return fn::GVArray_Typed<T>(std::move(varray));
+    return GVArray_Typed<T>(std::move(varray));
   }
 
   /**
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
index 5f2befb9510..022c93031c3 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_convert.cc
@@ -92,8 +92,8 @@ static void attribute_convert_calc(GeometryComponent &component,
     return;
   }
 
-  fn::GVArray_GSpan source_span{*source_attribute};
-  fn::GMutableSpan result_span = result_attribute.as_span();
+  GVArray_GSpan source_span{*source_attribute};
+  GMutableSpan result_span = result_attribute.as_span();
 
   BLI_assert(source_span.size() == result_span.size());
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
index da0d2e95a42..3c2d71ca327 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
@@ -178,7 +178,7 @@ Array<uint32_t> get_geometry_element_ids_as_uints(const GeometryComponent &compo
   if (hash_attribute) {
     BLI_assert(hashes.size() == hash_attribute->size());
     const CPPType &cpp_type = hash_attribute->type();
-    fn::GVArray_GSpan items{*hash_attribute};
+    GVArray_GSpan items{*hash_attribute};
     for (const int i : hashes.index_range()) {
       hashes[i] = cpp_type.hash(items[i]);
     }
@@ -234,7 +234,7 @@ static void randomize_attribute_on_component(GeometryComponent &component,
     return;
   }
 
-  fn::GMutableSpan span = attribute.as_span();
+  GMutableSpan span = attribute.as_span();
 
   Array<uint32_t> hashes = get_geometry_element_ids_as_uints(component, domain);
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
index 8774d71e15d..65d494f078e 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
@@ -164,7 +164,7 @@ static void fill_new_attribute(Span<const GeometryComponent *> src_components,
                                StringRef attribute_name,
                                const CustomDataType data_type,
                                const AttributeDomain domain,
-                               fn::GMutableSpan dst_span)
+                               GMutableSpan dst_span)
 {
   const CPPType *cpp_type = bke::custom_data_type_to_cpp_type(data_type);
   BLI_assert(cpp_type != nullptr);
@@ -178,7 +178,7 @@ static void fill_new_attribute(Span<const GeometryComponent *> src_components,
     std::unique_ptr<GVArray> read_attribute = component->attribute_get_for_read(
         attribute_name, domain, data_type, nullptr);
 
-    fn::GVArray_GSpan src_span{*read_attribute};
+    GVArray_GSpan src_span{*read_attribute};
     const void *src_buffer = src_span.data();
     void *dst_buffer = dst_span[offset];
     cpp_type->copy_to_initialized_n(src_buffer, dst_buffer, domain_size);
@@ -206,7 +206,7 @@ static void join_attributes(Span<const GeometryComponent *> src_components,
     if (!write_attribute) {
       continue;
     }
-    fn::GMutableSpan dst_span = write_attribute.as_span();
+    GMutableSpan dst_span = write_attribute.as_span();
     fill_new_attribute(src_components, attribute_name, data_type, domain, dst_span);
     write_attribute.save();
   }
diff --git a/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc b/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
index ba308280b32..858b27d80e8 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
@@ -369,7 +369,7 @@ BLI_NOINLINE static void interpolate_existing_attributes(
       continue;
     }
 
-    fn::GMutableSpan out_span = attribute_out.as_span();
+    GMutableSpan out_span = attribute_out.as_span();
 
     int i_instance = 0;
     for (const GeometryInstanceGroup &set_group : set_groups) {
@@ -398,7 +398,7 @@ BLI_NOINLINE static void interpolate_existing_attributes(
       attribute_math::convert_to_static_type(output_data_type, [&](auto dummy) {
         using T = decltype(dummy);
 
-        fn::GVArray_Span<T> source_span{*source_attribute};
+        GVArray_Span<T> source_span{*source_attribute};
 
         for (const int UNUSED(i_set_instance) : set_group.transforms.index_range()) {
           const int offset = instance_start_offsets[i_instance];



More information about the Bf-blender-cvs mailing list