[Bf-blender-cvs] [eba32b5f4a4] temp-geometry-nodes-fields-prototype: cleanup

Jacques Lucke noreply at git.blender.org
Wed Aug 18 12:53:34 CEST 2021


Commit: eba32b5f4a42e2d178d3314a2a143fabb8d84d21
Author: Jacques Lucke
Date:   Wed Aug 18 10:29:40 2021 +0200
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rBeba32b5f4a42e2d178d3314a2a143fabb8d84d21

cleanup

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

M	source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
M	source/blender/nodes/geometry/nodes/node_geo_attribute_extract.cc

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

diff --git a/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc b/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
index 7501202c3a8..fae61d67a48 100644
--- a/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
+++ b/source/blender/nodes/function/nodes/node_fn_align_rotation_to_vector.cc
@@ -146,24 +146,20 @@ static const blender::fn::MultiFunction &get_multi_function(bNode &node)
         }};
     return auto_pivot;
   }
-  else {
-    float3 local_pivot_axis{0, 0, 0};
-    local_pivot_axis[storage.pivot_axis - 1] = 1;
+  float3 local_pivot_axis{0, 0, 0};
+  local_pivot_axis[storage.pivot_axis - 1] = 1;
 
-    if (local_main_axis == local_pivot_axis) {
-      return blender::fn::dummy_multi_function;
-    }
-
-    static blender::fn::CustomMF_SI_SI_SI_SO<float3, float, float3, float3> fixed_pivot{
-        "Align Rotation Fixed Pivot",
-        [local_main_axis, local_pivot_axis](float3 rotation, float factor, float3 vector) {
-          return align_rotations_fixed_pivot(
-              vector, factor, local_main_axis, local_pivot_axis, rotation);
-        }};
-    return fixed_pivot;
+  if (local_main_axis == local_pivot_axis) {
+    return blender::fn::dummy_multi_function;
   }
 
-  return blender::fn::dummy_multi_function;
+  static blender::fn::CustomMF_SI_SI_SI_SO<float3, float, float3, float3> fixed_pivot{
+      "Align Rotation Fixed Pivot",
+      [local_main_axis, local_pivot_axis](float3 rotation, float factor, float3 vector) {
+        return align_rotations_fixed_pivot(
+            vector, factor, local_main_axis, local_pivot_axis, rotation);
+      }};
+  return fixed_pivot;
 }
 
 static void fn_node_align_rotation_to_vector_expand_in_mf_network(
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_extract.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_extract.cc
index 3bd0114b035..bb362916b52 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_extract.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_extract.cc
@@ -110,7 +110,7 @@ static void geo_node_attribute_extract_exec(GeoNodeExecParams params)
 
   const std::string attribute_name = params.get_input<std::string>("Attribute");
   AnonymousCustomDataLayerID *layer_id = CustomData_anonymous_id_new(attribute_name.c_str());
-  auto output_field = new bke::AnonymousAttributeField(*layer_id, *cpp_type);
+  auto *output_field = new bke::AnonymousAttributeField(*layer_id, *cpp_type);
 
   if (geometry_set.has<MeshComponent>()) {
     convert_attribute(geometry_set.get_component_for_write<MeshComponent>(),



More information about the Bf-blender-cvs mailing list