diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-25 21:39:51 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-25 21:40:07 +0300 |
commit | f431be224fa58374386a32dba2542ee20d2a2d61 (patch) | |
tree | 7470402341cd9e9b8f5dbb50dc101249bf15c4bb /source/blender/geometry | |
parent | 845e2ed3a282913cd9d37207a313627275acc158 (diff) |
Curves: Cache the number of curves of each type
Remembering the number of curves of every type makes it fast to know
whether processing specific to a single curve type has to be done.
This information was accessed in quite a few places, so this should be
an overall reduction in overhead for the new curves type.
The cache is computed eagerly, in other words every time after changing
the curve types. In order to reduce verbosity I added helper functions
for some common ways to set the types.
Differential Revision: https://developer.blender.org/D14732
Diffstat (limited to 'source/blender/geometry')
-rw-r--r-- | source/blender/geometry/intern/mesh_to_curve_convert.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/geometry/intern/mesh_to_curve_convert.cc b/source/blender/geometry/intern/mesh_to_curve_convert.cc index a8eaa828caf..a1e5f0216b6 100644 --- a/source/blender/geometry/intern/mesh_to_curve_convert.cc +++ b/source/blender/geometry/intern/mesh_to_curve_convert.cc @@ -38,7 +38,7 @@ static Curves *create_curve_from_vert_indices(const MeshComponent &mesh_componen bke::CurvesGeometry &curves = bke::CurvesGeometry::wrap(curves_id->geometry); curves.offsets_for_write().drop_back(1).copy_from(curve_offsets); curves.offsets_for_write().last() = vert_indices.size(); - curves.curve_types_for_write().fill(CURVE_TYPE_POLY); + curves.fill_curve_types(CURVE_TYPE_POLY); curves.cyclic_for_write().fill(false); curves.cyclic_for_write().slice(cyclic_curves).fill(true); |