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-07-20 05:50:45 +0300
committerHans Goudey <h.goudey@me.com>2022-07-20 05:50:45 +0300
commit8c5d90f5ce928e45249ddd9f642c24b6dd69d64c (patch)
treeccbbf8f065eadbe85cdc1f8d70a9d036e9c030b5 /source/blender/blenkernel/intern/curves.cc
parent111bf7d76b080555fd524b2b4a138bcad2e5b206 (diff)
parent215f805ce6b540177dedd71721e62c56a764a5ea (diff)
Merge branch 'master' into temp-legacy-mesh-format-optiontemp-legacy-mesh-format-option
Diffstat (limited to 'source/blender/blenkernel/intern/curves.cc')
-rw-r--r--source/blender/blenkernel/intern/curves.cc27
1 files changed, 17 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/curves.cc b/source/blender/blenkernel/intern/curves.cc
index 78791b55b4d..5684a2e5b07 100644
--- a/source/blender/blenkernel/intern/curves.cc
+++ b/source/blender/blenkernel/intern/curves.cc
@@ -53,8 +53,6 @@ using blender::Vector;
static const char *ATTR_POSITION = "position";
-static void update_custom_data_pointers(Curves &curves);
-
static void curves_init_data(ID *id)
{
Curves *curves = (Curves *)id;
@@ -97,8 +95,6 @@ static void curves_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src,
dst.runtime->type_counts = src.runtime->type_counts;
- dst.update_customdata_pointers();
-
curves_dst->batch_cache = nullptr;
}
@@ -170,7 +166,6 @@ static void curves_blend_read_data(BlendDataReader *reader, ID *id)
/* Geometry */
CustomData_blend_read(reader, &curves->geometry.point_data, curves->geometry.point_num);
CustomData_blend_read(reader, &curves->geometry.curve_data, curves->geometry.curve_num);
- update_custom_data_pointers(*curves);
BLO_read_int32_array(reader, curves->geometry.curve_num + 1, &curves->geometry.curve_offsets);
@@ -233,11 +228,6 @@ IDTypeInfo IDType_ID_CV = {
/*lib_override_apply_post */ nullptr,
};
-static void update_custom_data_pointers(Curves &curves)
-{
- blender::bke::CurvesGeometry::wrap(curves.geometry).update_customdata_pointers();
-}
-
void *BKE_curves_add(Main *bmain, const char *name)
{
Curves *curves = static_cast<Curves *>(BKE_id_new(bmain, ID_CV, name));
@@ -388,6 +378,23 @@ Curves *curves_new_nomain(CurvesGeometry curves)
return curves_id;
}
+void curves_copy_parameters(const Curves &src, Curves &dst)
+{
+ dst.flag = src.flag;
+ dst.attributes_active_index = src.attributes_active_index;
+ MEM_SAFE_FREE(dst.mat);
+ dst.mat = static_cast<Material **>(MEM_malloc_arrayN(src.totcol, sizeof(Material *), __func__));
+ dst.totcol = src.totcol;
+ MutableSpan(dst.mat, dst.totcol).copy_from(Span(src.mat, src.totcol));
+ dst.symmetry = src.symmetry;
+ dst.selection_domain = src.selection_domain;
+ dst.surface = src.surface;
+ MEM_SAFE_FREE(dst.surface_uv_map);
+ if (src.surface_uv_map != nullptr) {
+ dst.surface_uv_map = BLI_strdup(src.surface_uv_map);
+ }
+}
+
CurvesSurfaceTransforms::CurvesSurfaceTransforms(const Object &curves_ob, const Object *surface_ob)
{
this->curves_to_world = curves_ob.obmat;