[Bf-blender-cvs] [b5bd676a511] geometry-nodes-curve-support: Geometry Nodes Curves: Apply scale instead of set scale

Hans Goudey noreply at git.blender.org
Fri Apr 9 06:17:15 CEST 2021


Commit: b5bd676a5111132081b8e69fd9e1ab4b356b95d0
Author: Hans Goudey
Date:   Thu Apr 8 17:01:22 2021 -0500
Branches: geometry-nodes-curve-support
https://developer.blender.org/rBb5bd676a5111132081b8e69fd9e1ab4b356b95d0

Geometry Nodes Curves: Apply scale instead of set scale

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

M	source/blender/blenlib/BLI_float4x4.hh
M	source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc

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

diff --git a/source/blender/blenlib/BLI_float4x4.hh b/source/blender/blenlib/BLI_float4x4.hh
index 33b43ddd3b0..a72627cde7c 100644
--- a/source/blender/blenlib/BLI_float4x4.hh
+++ b/source/blender/blenlib/BLI_float4x4.hh
@@ -147,9 +147,11 @@ struct float4x4 {
     return scale;
   }
 
-  void set_scale(const float scale)
+  void apply_scale(const float scale)
   {
-    values[0][0] = values[1][1] = values[2][2] = scale;
+    values[0][0] *= scale;
+    values[1][1] *= scale;
+    values[2][2] *= scale;
   }
 
   float4x4 inverted() const
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
index 6adf3724bdd..51f2aa1f76f 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc
@@ -148,6 +148,7 @@ static void spline_extrude_to_mesh_data(const Spline &spline,
       MPoly &poly = polys[poly_offset++];
       poly.loopstart = loop_offset;
       poly.totloop = 4;
+      poly.flag = ME_SMOOTH;
 
       MLoop &loop_a = loops[loop_offset++];
       loop_a.v = ring_vert_offset + i_profile;
@@ -174,13 +175,19 @@ static void spline_extrude_to_mesh_data(const Spline &spline,
         positions[i_ring], tangents[i_ring], normals[i_ring]);
 
     const float radius = spline.get_evaluated_point_radius(i_ring);
-    point_matrix.set_scale(radius);
+    point_matrix.apply_scale(radius);
 
     for (const int i_profile : IndexRange(profile_vert_len)) {
       MVert &vert = verts[vert_offset++];
       copy_v3_v3(vert.co, point_matrix * profile_positions[i_profile]);
     }
   }
+
+  /* Mark edge loops from sharp vector control points sharp. */
+  // if (profile_spline.type == Spline::Bezier) {
+  //   const BezierSpline &bezier_spline = static_cast<const BezierSpline &>(profile_spline);
+  //   for (const int i : bezier_spline.ev)
+  // }
 }
 
 static Mesh *curve_to_mesh_calculate(const DCurve &curve, const DCurve &profile_curve)



More information about the Bf-blender-cvs mailing list