[Bf-blender-cvs] [f94333ac291] temp-vert-normals-cleanup: Merge branch 'master' into temp-vert-normals-cleanup
Hans Goudey
noreply at git.blender.org
Fri Nov 26 15:32:15 CET 2021
Commit: f94333ac291f515b283725a63a57db0d6d589002
Author: Hans Goudey
Date: Fri Nov 26 08:13:16 2021 -0500
Branches: temp-vert-normals-cleanup
https://developer.blender.org/rBf94333ac291f515b283725a63a57db0d6d589002
Merge branch 'master' into temp-vert-normals-cleanup
===================================================================
===================================================================
diff --cc source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc
index c3d082216f8,cda55eadaf6..a584ce3c38b
--- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc
@@@ -170,6 -139,43 +139,39 @@@ static void node_geo_exec(GeoNodeExecPa
params.set_output("Mesh", GeometrySet::create_with_mesh(mesh));
}
+ } // namespace blender::nodes::node_geo_mesh_primitive_line_cc
+
+ namespace blender::nodes {
+
+ static void fill_edge_data(MutableSpan<MEdge> edges)
+ {
+ for (const int i : edges.index_range()) {
+ edges[i].v1 = i;
+ edges[i].v2 = i + 1;
+ edges[i].flag |= ME_LOOSEEDGE;
+ }
+ }
+
+ Mesh *create_line_mesh(const float3 start, const float3 delta, const int count)
+ {
+ if (count < 1) {
+ return nullptr;
+ }
+
+ Mesh *mesh = BKE_mesh_new_nomain(count, count - 1, 0, 0, 0);
+ BKE_id_material_eval_ensure_default_slot(&mesh->id);
+ MutableSpan<MVert> verts{mesh->mvert, mesh->totvert};
+ MutableSpan<MEdge> edges{mesh->medge, mesh->totedge};
+
- short normal[3];
- normal_float_to_short_v3(normal, delta.normalized());
-
+ for (const int i : verts.index_range()) {
+ copy_v3_v3(verts[i].co, start + delta * i);
- copy_v3_v3_short(verts[i].no, normal);
+ }
+
+ fill_edge_data(edges);
+
+ return mesh;
+ }
+
} // namespace blender::nodes
void register_node_type_geo_mesh_primitive_line()
More information about the Bf-blender-cvs
mailing list