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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-01-28 23:48:09 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-01-28 23:49:23 +0300
commit5537117366db2a1af118a06ac89ba223de8c690e (patch)
treeff74aaf159ad51d79a7b653538005eb7900cb208 /source/blender/modifiers/intern/MOD_surface.c
parent147e22ef700124dcbaa5576b72a2a77e73adf350 (diff)
Fix several missing cases of copy func for modifiers.
Any time a modifier data has non-ID pointer, it should have own copy function (and also take care of proper init/reset in its init callback).
Diffstat (limited to 'source/blender/modifiers/intern/MOD_surface.c')
-rw-r--r--source/blender/modifiers/intern/MOD_surface.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c
index a7198b5721e..248292ded35 100644
--- a/source/blender/modifiers/intern/MOD_surface.c
+++ b/source/blender/modifiers/intern/MOD_surface.c
@@ -59,6 +59,21 @@ static void initData(ModifierData *md)
SurfaceModifierData *surmd = (SurfaceModifierData *) md;
surmd->bvhtree = NULL;
+ surmd->mesh = NULL;
+ surmd->x = NULL;
+ surmd->v = NULL;
+}
+
+static void copyData(const ModifierData *md_src, ModifierData *md_dst, const int flag)
+{
+ SurfaceModifierData *surmd_dst = (SurfaceModifierData *)md_dst;
+
+ modifier_copyData_generic(md_src, md_dst, flag);
+
+ surmd_dst->bvhtree = NULL;
+ surmd_dst->mesh = NULL;
+ surmd_dst->x = NULL;
+ surmd_dst->v = NULL;
}
static void freeData(ModifierData *md)
@@ -194,7 +209,7 @@ ModifierTypeInfo modifierType_Surface = {
eModifierTypeFlag_AcceptsCVs |
eModifierTypeFlag_NoUserAdd,
- /* copyData */ NULL,
+ /* copyData */ copyData,
/* deformVerts_DM */ NULL,
/* deformMatrices_DM */ NULL,