[Bf-blender-cvs] [5609f61bb31] refactor-mesh-sharp-edge-generic: Merge branch 'master' into refactor-mesh-sharp-edge-generic
Hans Goudey
noreply at git.blender.org
Mon Jan 9 19:21:26 CET 2023
Commit: 5609f61bb315032fafba7b3f402352d47069b61d
Author: Hans Goudey
Date: Mon Jan 9 13:16:58 2023 -0500
Branches: refactor-mesh-sharp-edge-generic
https://developer.blender.org/rB5609f61bb315032fafba7b3f402352d47069b61d
Merge branch 'master' into refactor-mesh-sharp-edge-generic
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/curve_to_mesh_convert.cc
index 011646ffd19,9e8eaccb024..12da300598b
--- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc
+++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc
@@@ -617,41 -627,10 +617,42 @@@ static void copy_curve_domain_attribute
});
}
+static void write_sharp_bezier_edges(const CurvesInfo &curves_info,
+ const ResultOffsets &offsets,
+ MutableAttributeAccessor mesh_attributes,
+ SpanAttributeWriter<bool> &sharp_edges)
+{
+ const CurvesGeometry &profile = curves_info.profile;
+ if (!profile.has_curve_with_type(CURVE_TYPE_BEZIER)) {
+ return;
+ }
+ const VArraySpan<int8_t> handle_types_left{profile.handle_types_left()};
+ const VArraySpan<int8_t> handle_types_right{profile.handle_types_right()};
+ if (!handle_types_left.contains(BEZIER_HANDLE_VECTOR) &&
+ !handle_types_right.contains(BEZIER_HANDLE_VECTOR)) {
+ return;
+ }
+
+ sharp_edges = mesh_attributes.lookup_or_add_for_write_span<bool>("sharp_edge", ATTR_DOMAIN_EDGE);
+
+ const VArray<int8_t> types = profile.curve_types();
+ foreach_curve_combination(curves_info, offsets, [&](const CombinationInfo &info) {
+ if (types[info.i_profile] == CURVE_TYPE_BEZIER) {
+ const IndexRange points = profile.points_for_curve(info.i_profile);
+ mark_bezier_vector_edges_sharp(points.size(),
+ info.main_segment_num,
+ profile.bezier_evaluated_offsets_for_curve(info.i_profile),
+ handle_types_left.slice(points),
+ handle_types_right.slice(points),
+ sharp_edges.span.slice(info.edge_range));
+ }
+ });
+}
+
Mesh *curve_to_mesh_sweep(const CurvesGeometry &main,
const CurvesGeometry &profile,
- const bool fill_caps)
+ const bool fill_caps,
+ const AnonymousAttributePropagationInfo &propagation_info)
{
const CurvesInfo curves_info = get_curves_info(main, profile);
@@@ -743,8 -714,11 +744,9 @@@
Set<AttributeIDRef> main_attributes_set;
- MutableAttributeAccessor mesh_attributes = mesh->attributes_for_write();
-
main_attributes.for_all([&](const AttributeIDRef &id, const AttributeMetaData meta_data) {
- if (!should_add_attribute_to_mesh(main_attributes, mesh_attributes, id, meta_data)) {
+ if (!should_add_attribute_to_mesh(
+ main_attributes, mesh_attributes, id, meta_data, propagation_info)) {
return true;
}
main_attributes_set.add_new(id);
More information about the Bf-blender-cvs
mailing list