[Bf-blender-cvs] [32e8381e0e4] temp-scale-elements-node-test: Geometry Nodes: Experimental Scale Elements node (WIP).
Jacques Lucke
noreply at git.blender.org
Fri Jan 7 08:02:35 CET 2022
Commit: 32e8381e0e4b97e6acbaa145dc222ca1bdbbac11
Author: Jacques Lucke
Date: Thu Jan 6 17:20:57 2022 +0100
Branches: temp-scale-elements-node-test
https://developer.blender.org/rB32e8381e0e4b97e6acbaa145dc222ca1bdbbac11
Geometry Nodes: Experimental Scale Elements node (WIP).
This node is best used in combination with e.g. the Extrude node.
Differential Revision: https://developer.blender.org/D13757
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc
index 052197fd259..299d8ec813a 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc
@@ -99,14 +99,6 @@ static void scale_faces(MeshComponent &mesh_component, const InputFields &input_
group_info.tot_faces++;
}
- for (GroupData &group_data : groups_data) {
- if (group_data.tot_faces >= 2) {
- const float f = 1.0f / group_data.tot_faces;
- group_data.scale *= f;
- group_data.pivot *= f;
- }
- }
-
Array<float4x4> transforms(group_amount);
threading::parallel_for(IndexRange(mesh->totvert), 1024, [&](const IndexRange range) {
for (const int vert_index : range) {
@@ -116,6 +108,10 @@ static void scale_faces(MeshComponent &mesh_component, const InputFields &input_
continue;
}
+ const float f = 1.0f / group_data.tot_faces;
+ group_data.scale *= f;
+ group_data.pivot *= f;
+
const float3 x_axis = group_data.x_axis.normalized();
const float3 y_axis = -float3::cross(x_axis, group_data.up).normalized();
const float3 z_axis = float3::cross(x_axis, y_axis);
More information about the Bf-blender-cvs
mailing list