Fix #119715: Curve sculpt puff brush causes hairs to move erratically

Caused by 98bf7a8d7a / ff7b8f3412

Since the `curve_weights` array was created uninitialized, and the above
commits were doing `math::max_inplace` on the uninitialized data, this
could end up with garbage values.

Now initialize the array properly to prevent this.

Pull Request: https://projects.blender.org/blender/blender/pulls/119730
This commit is contained in:
Philipp Oeser
2024-03-21 11:52:31 +01:00
committed by Philipp Oeser
parent ddcfc46ee6
commit 5fa1915d47
@@ -135,7 +135,7 @@ struct PuffOperationExecutor {
*curves_, curve_selection_, curves_id_->flag & CV_SCULPT_COLLISION_ENABLED);
}
Array<float> curve_weights(curves_->curves_num());
Array<float> curve_weights(curves_->curves_num(), 0.0f);
if (falloff_shape == PAINT_FALLOFF_SHAPE_TUBE) {
this->find_curve_weights_projected_with_symmetry(curve_weights);