[Bf-blender-cvs] [98ad294d171] master: Fix: Correctly copy and update curve type counts cache

Hans Goudey noreply at git.blender.org
Tue Apr 26 01:48:42 CEST 2022


Commit: 98ad294d1719eb9cec01af08a0db16558e9964a5
Author: Hans Goudey
Date:   Mon Apr 25 18:48:35 2022 -0500
Branches: master
https://developer.blender.org/rB98ad294d1719eb9cec01af08a0db16558e9964a5

Fix: Correctly copy and update curve type counts cache

Missing from f431be224fa583743.

===================================================================

M	source/blender/blenkernel/intern/curves.cc

===================================================================

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);
 }



More information about the Bf-blender-cvs mailing list