Fix T101926: Curves: Remove type-specific attributes when deleting

Remove NURBS or Bezier specific attributes after removing points or
curves. In theory we could avoid copying those attributes in the
first place, but that doesn't seem worth the extra complexity here,
since we don't necessarily know the result curve type counts before
copying attributes.
This commit is contained in:
Hans Goudey 2022-10-19 13:39:23 -05:00
parent 193b456d2d
commit d046c8c9d7
Notes: blender-bot 2023-02-14 07:36:17 +01:00
Referenced by issue #101926, Separate Geometry prevents Set Spline Type from removing Bezier related named attributes.
1 changed files with 6 additions and 0 deletions

View File

@ -1224,6 +1224,10 @@ static CurvesGeometry copy_with_removed_points(const CurvesGeometry &curves,
attribute.dst.finish();
}
if (new_curves.curves_num() != curves.curves_num()) {
new_curves.remove_attributes_based_on_types();
}
return new_curves;
}
@ -1329,6 +1333,8 @@ static CurvesGeometry copy_with_removed_curves(const CurvesGeometry &curves,
attribute.dst.finish();
}
new_curves.remove_attributes_based_on_types();
return new_curves;
}