Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-07-22 03:44:06 +0300
committerHans Goudey <h.goudey@me.com>2022-07-22 03:44:06 +0300
commitaa1ffc093c4711a40932c854670730944008118b (patch)
treec77b3510bda990c4c4c9ba1be0a19dcd0a85cc76 /source/blender/blenkernel/intern/curve_eval.cc
parent7a4a6ccad74f9a2094e9f0928f5ac61ffd6346ff (diff)
Fix T99884: Crash when converting to old curve type
The conversion from Curves to CurveEval used an incorrect type for one of the builtin attributes. Also, an incorrect default was used for reading the nurbs_weight attribute.
Diffstat (limited to 'source/blender/blenkernel/intern/curve_eval.cc')
-rw-r--r--source/blender/blenkernel/intern/curve_eval.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc
index 424fa311dc7..3bee82fadab 100644
--- a/source/blender/blenkernel/intern/curve_eval.cc
+++ b/source/blender/blenkernel/intern/curve_eval.cc
@@ -382,7 +382,7 @@ std::unique_ptr<CurveEval> curves_to_curve_eval(const Curves &curves_id)
VArray<int8_t> normal_mode = curves.normal_mode();
VArraySpan<float> nurbs_weights{
- src_attributes.lookup_or_default<float>("nurbs_weight", ATTR_DOMAIN_POINT, 0.0f)};
+ src_attributes.lookup_or_default<float>("nurbs_weight", ATTR_DOMAIN_POINT, 1.0f)};
VArraySpan<int8_t> nurbs_orders{
src_attributes.lookup_or_default<int8_t>("nurbs_order", ATTR_DOMAIN_CURVE, 4)};
VArraySpan<int8_t> nurbs_knots_modes{
@@ -475,13 +475,13 @@ Curves *curve_eval_to_curves(const CurveEval &curve_eval)
blender::bke::SpanAttributeWriter<int8_t> normal_mode =
dst_attributes.lookup_or_add_for_write_only_span<int8_t>("normal_mode", ATTR_DOMAIN_CURVE);
blender::bke::SpanAttributeWriter<float> nurbs_weight;
- blender::bke::SpanAttributeWriter<int> nurbs_order;
+ blender::bke::SpanAttributeWriter<int8_t> nurbs_order;
blender::bke::SpanAttributeWriter<int8_t> nurbs_knots_mode;
if (curve_eval.has_spline_with_type(CURVE_TYPE_NURBS)) {
nurbs_weight = dst_attributes.lookup_or_add_for_write_only_span<float>("nurbs_weight",
ATTR_DOMAIN_POINT);
- nurbs_order = dst_attributes.lookup_or_add_for_write_only_span<int>("nurbs_order",
- ATTR_DOMAIN_CURVE);
+ nurbs_order = dst_attributes.lookup_or_add_for_write_only_span<int8_t>("nurbs_order",
+ ATTR_DOMAIN_CURVE);
nurbs_knots_mode = dst_attributes.lookup_or_add_for_write_only_span<int8_t>("knots_mode",
ATTR_DOMAIN_CURVE);
}