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
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')
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c11
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c1
-rw-r--r--source/blender/modifiers/intern/MOD_surface.c17
3 files changed, 27 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index 98f455e186c..0b29c6bb64b 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -66,6 +66,15 @@ static void initData(ModifierData *md)
mmd->quality = 3;
}
+static void copyData(const ModifierData *md_src, ModifierData *md_dst, const int flag)
+{
+ MultiresModifierData *mmd_dst = (MultiresModifierData *)md_dst;
+
+ modifier_copyData_generic(md_src, md_dst, flag);
+
+ mmd_dst->subdiv = NULL;
+}
+
static void freeData(ModifierData *md)
{
MultiresModifierData *mmd = (MultiresModifierData *) md;
@@ -193,7 +202,7 @@ ModifierTypeInfo modifierType_Multires = {
eModifierTypeFlag_SupportsMapping |
eModifierTypeFlag_RequiresOriginalData,
- /* copyData */ modifier_copyData_generic,
+ /* copyData */ copyData,
/* deformVerts_DM */ NULL,
/* deformMatrices_DM */ NULL,
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index 3cabd1131cb..347ac306f3d 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -75,6 +75,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
modifier_copyData_generic(md, target, flag);
tsmd->emCache = tsmd->mCache = NULL;
+ tsmd->subdiv = NULL;
}
static void freeData(ModifierData *md)
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,