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-04-22 18:26:08 +0300
committerHans Goudey <h.goudey@me.com>2022-04-22 18:27:15 +0300
commita7c65ef4cbbd71972170cc8406a85b2332d304f2 (patch)
treec2c0f0a50ac79a0f3d4cc36f5fbacc3149b6fe1e /source/blender/blenkernel/intern/curve.cc
parent75aa5ecbda6f9fb5116fc582105991cc6c1a8f72 (diff)
Fix T96498: Modifiers affect multiple curve objects
The original mistake I made in b9febb54a492ac6c938 was thinking that the input curve object data to `BKE_displist_make_curveTypes` was already copied from the original. I think I misread some of its `ID` flags. This commit places the result of curves evaluation in a duplicated curve instead, and copies the edit mode pointers necessary for drawing overlays. `Curve` needs to know not to free those pointers. I still don't have a full understanding of why some of the tactics I've used work and others don't. I've probably tried around 8 different solutions at this point, and this is the best I came up with. The dependency graph seems to have some handling of edit mode pointers that make the edit mode overlays work if the evaluated result is only an empty curve created by the evaluated geometry set. This doesn't work with the current method and I need to set the edit mode pointers at the end of evaluation explicitly. We're constrained by the confusing duality of the old curves system combined with the new design using the evaluated geometry set. Older areas of Blender expect the evaluated `Curve` to be a copy of the original, even if it was replaced by some arbitrary evaluated mesh. Differential Revision: https://developer.blender.org/D14561
Diffstat (limited to 'source/blender/blenkernel/intern/curve.cc')
-rw-r--r--source/blender/blenkernel/intern/curve.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/curve.cc b/source/blender/blenkernel/intern/curve.cc
index bad70d4ccc6..4338883853d 100644
--- a/source/blender/blenkernel/intern/curve.cc
+++ b/source/blender/blenkernel/intern/curve.cc
@@ -113,9 +113,12 @@ static void curve_free_data(ID *id)
BKE_curve_batch_cache_free(curve);
BKE_nurbList_free(&curve->nurb);
- BKE_curve_editfont_free(curve);
- BKE_curve_editNurb_free(curve);
+ if (!curve->edit_data_from_original) {
+ BKE_curve_editfont_free(curve);
+
+ BKE_curve_editNurb_free(curve);
+ }
BKE_curveprofile_free(curve->bevel_profile);