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-26 02:48:35 +0300
committerHans Goudey <h.goudey@me.com>2022-04-26 02:48:35 +0300
commit98ad294d1719eb9cec01af08a0db16558e9964a5 (patch)
tree4f72853d229942ef844b8bb6083a6303fb31c336
parent96834a7bacffc97d87af6b8b89aa2a091b5b094a (diff)
Fix: Correctly copy and update curve type counts cache
Missing from f431be224fa583743.
-rw-r--r--source/blender/blenkernel/intern/curves.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curves.cc b/source/blender/blenkernel/intern/curves.cc
index a3b40b27583..1df1492bac1 100644
--- a/source/blender/blenkernel/intern/curves.cc
+++ b/source/blender/blenkernel/intern/curves.cc
@@ -89,6 +89,8 @@ static void curves_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src,
dst.runtime = MEM_new<bke::CurvesGeometryRuntime>(__func__);
+ dst.runtime->type_counts = src.runtime->type_counts;
+
dst.update_customdata_pointers();
curves_dst->batch_cache = nullptr;
@@ -175,6 +177,9 @@ static void curves_blend_read_data(BlendDataReader *reader, ID *id)
curves->geometry.runtime = MEM_new<blender::bke::CurvesGeometryRuntime>(__func__);
+ /* Recalculate curve type count cache that isn't saved in files. */
+ blender::bke::CurvesGeometry::wrap(curves->geometry).update_curve_types();
+
/* Materials */
BLO_read_pointer_array(reader, (void **)&curves->mat);
}