[Bf-blender-cvs] [e46dcc499c3] geometry-nodes-mesh-primitives: Revert changes split to a separate patch
Hans Goudey
noreply at git.blender.org
Sat Mar 13 23:31:50 CET 2021
Commit: e46dcc499c392f7cae9bd765d5db223c30dd09b1
Author: Hans Goudey
Date: Sat Mar 13 17:29:43 2021 -0500
Branches: geometry-nodes-mesh-primitives
https://developer.blender.org/rBe46dcc499c392f7cae9bd765d5db223c30dd09b1
Revert changes split to a separate patch
D10712
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_transform.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_transform.cc b/source/blender/nodes/geometry/nodes/node_geo_transform.cc
index 341bb4c0472..539a7551be9 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_transform.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_transform.cc
@@ -20,8 +20,6 @@
#include "BLI_math_matrix.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_volume_types.h"
@@ -59,34 +57,20 @@ static bool use_translate(const float3 rotation, const float3 scale)
return true;
}
-void transform_mesh(Mesh *mesh,
- const float3 translation,
- const float3 rotation,
- const float3 scale)
+static void transform_mesh(Mesh *mesh,
+ const float3 translation,
+ const float3 rotation,
+ const float3 scale)
{
/* Use only translation if rotation and scale are zero. */
if (use_translate(rotation, scale)) {
BKE_mesh_translate(mesh, translation, true);
}
else {
- float4x4 matrix;
- loc_eul_size_to_mat4(matrix.values, translation, rotation, scale);
- BKE_mesh_transform(mesh, matrix.values, true);
-
- /* https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/
- * geometry/transforming-normals */
- float rot[3][3];
- eul_to_mat3(rot, rotation);
- if (!invert_m3(rot)) {
- return;
- }
- transpose_m3(rot);
- for (MVert &vert : MutableSpan(mesh->mvert, mesh->totvert)) {
- float3 normal;
- normal_short_to_float_v3(normal, vert.no);
- mul_m3_v3(rot, normal);
- normal_float_to_short_v3(vert.no, normal);
- }
+ float mat[4][4];
+ loc_eul_size_to_mat4(mat, translation, rotation, scale);
+ BKE_mesh_transform(mesh, mat, true);
+ BKE_mesh_calc_normals(mesh);
}
}
More information about the Bf-blender-cvs
mailing list