diff options
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_armature.c | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_collision.c | 32 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_explode.c | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshsequencecache.c | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_particlesystem.c | 16 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_subsurf.c | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_surface.c | 15 |
8 files changed, 110 insertions, 8 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index cf702c7d40d..b62c03d1b03 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -49,6 +49,8 @@ #include "RNA_access.h" +#include "BLO_read_write.h" + #include "DEG_depsgraph_query.h" #include "bmesh.h" @@ -261,6 +263,13 @@ static void panelRegister(ARegionType *region_type) modifier_panel_register(region_type, eModifierType_Armature, panel_draw); } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + ArmatureModifierData *amd = (ArmatureModifierData *)md; + + amd->vert_coords_prev = NULL; +} + ModifierTypeInfo modifierType_Armature = { /* name */ "Armature", /* structName */ "ArmatureModifierData", @@ -293,5 +302,5 @@ ModifierTypeInfo modifierType_Armature = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 7a338b59e98..a355558a3ba 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -54,6 +54,8 @@ #include "MOD_ui_common.h" #include "MOD_util.h" +#include "BLO_read_write.h" + #include "DEG_depsgraph_query.h" static void initData(ModifierData *md) @@ -269,6 +271,34 @@ static void panelRegister(ARegionType *region_type) modifier_panel_register(region_type, eModifierType_Collision, panel_draw); } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + CollisionModifierData *collmd = (CollisionModifierData *)md; +#if 0 + // TODO: CollisionModifier should use pointcache + // + have proper reset events before enabling this + collmd->x = newdataadr(fd, collmd->x); + collmd->xnew = newdataadr(fd, collmd->xnew); + collmd->mfaces = newdataadr(fd, collmd->mfaces); + + collmd->current_x = MEM_calloc_arrayN(collmd->numverts, sizeof(MVert), "current_x"); + collmd->current_xnew = MEM_calloc_arrayN(collmd->numverts, sizeof(MVert), "current_xnew"); + collmd->current_v = MEM_calloc_arrayN(collmd->numverts, sizeof(MVert), "current_v"); +#endif + + collmd->x = NULL; + collmd->xnew = NULL; + collmd->current_x = NULL; + collmd->current_xnew = NULL; + collmd->current_v = NULL; + collmd->time_x = collmd->time_xnew = -1000; + collmd->mvert_num = 0; + collmd->tri_num = 0; + collmd->is_static = false; + collmd->bvhtree = NULL; + collmd->tri = NULL; +} + ModifierTypeInfo modifierType_Collision = { /* name */ "Collision", /* structName */ "CollisionModifierData", @@ -300,5 +330,5 @@ ModifierTypeInfo modifierType_Collision = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 00e39a7ea6c..29f7294c202 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -49,6 +49,8 @@ #include "UI_interface.h" #include "UI_resources.h" +#include "BLO_read_write.h" + #include "RNA_access.h" #include "DEG_depsgraph_query.h" @@ -1228,6 +1230,13 @@ static void panelRegister(ARegionType *region_type) modifier_panel_register(region_type, eModifierType_Explode, panel_draw); } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + ExplodeModifierData *psmd = (ExplodeModifierData *)md; + + psmd->facepa = NULL; +} + ModifierTypeInfo modifierType_Explode = { /* name */ "Explode", /* structName */ "ExplodeModifierData", @@ -1258,5 +1267,5 @@ ModifierTypeInfo modifierType_Explode = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c index b4269513f8e..9eae7ae941f 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.c +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c @@ -44,6 +44,8 @@ #include "RNA_access.h" +#include "BLO_read_write.h" + #include "DEG_depsgraph_build.h" #include "DEG_depsgraph_query.h" @@ -229,6 +231,13 @@ static void panelRegister(ARegionType *region_type) modifier_panel_register(region_type, eModifierType_MeshSequenceCache, panel_draw); } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + MeshSeqCacheModifierData *msmcd = (MeshSeqCacheModifierData *)md; + msmcd->reader = NULL; + msmcd->reader_object_path[0] = '\0'; +} + ModifierTypeInfo modifierType_MeshSequenceCache = { /* name */ "MeshSequenceCache", /* structName */ "MeshSeqCacheModifierData", @@ -260,5 +269,5 @@ ModifierTypeInfo modifierType_MeshSequenceCache = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 1cdba84bb27..88581464a02 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -49,6 +49,8 @@ #include "RNA_access.h" +#include "BLO_read_write.h" + #include "WM_types.h" /* For UI free bake operator. */ #include "DEG_depsgraph_query.h" @@ -674,6 +676,13 @@ static void panelRegister(ARegionType *region_type) #endif /* WITH_OCEANSIM */ } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + OceanModifierData *omd = (OceanModifierData *)md; + omd->oceancache = NULL; + omd->ocean = NULL; +} + ModifierTypeInfo modifierType_Ocean = { /* name */ "Ocean", /* structName */ "OceanModifierData", @@ -706,5 +715,5 @@ ModifierTypeInfo modifierType_Ocean = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 8c25c3eb4ba..ea0c63da1b0 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -46,6 +46,8 @@ #include "DEG_depsgraph_query.h" +#include "BLO_read_write.h" + #include "MOD_ui_common.h" #include "MOD_util.h" @@ -295,6 +297,18 @@ static void panelRegister(ARegionType *region_type) modifier_panel_register(region_type, eModifierType_ParticleSystem, panel_draw); } +static void blendRead(BlendDataReader *reader, ModifierData *md) +{ + ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md; + + psmd->mesh_final = NULL; + psmd->mesh_original = NULL; + /* This is written as part of ob->particlesystem. */ + BLO_read_data_address(reader, &psmd->psys); + psmd->flag &= ~eParticleSystemFlag_psys_updated; + psmd->flag |= eParticleSystemFlag_file_loaded; +} + ModifierTypeInfo modifierType_ParticleSystem = { /* name */ "ParticleSystem", /* structName */ "ParticleSystemModifierData", @@ -330,5 +344,5 @@ ModifierTypeInfo modifierType_ParticleSystem = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index aca4cad95b8..2ab59b28678 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -57,6 +57,8 @@ #include "MOD_modifiertypes.h" #include "MOD_ui_common.h" +#include "BLO_read_write.h" + #include "intern/CCGSubSurf.h" typedef struct SubsurfRuntimeData { @@ -425,6 +427,13 @@ static void panelRegister(ARegionType *region_type) region_type, "advanced", "Advanced", NULL, advanced_panel_draw, panel_type); } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + SubsurfModifierData *smd = (SubsurfModifierData *)md; + + smd->emCache = smd->mCache = NULL; +} + ModifierTypeInfo modifierType_Subsurf = { /* name */ "Subdivision", /* structName */ "SubsurfModifierData", @@ -458,5 +467,5 @@ ModifierTypeInfo modifierType_Subsurf = { /* freeRuntimeData */ freeRuntimeData, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 32b342b1471..e476e01a9f2 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -51,6 +51,8 @@ #include "MOD_ui_common.h" #include "MOD_util.h" +#include "BLO_read_write.h" + #include "MEM_guardedalloc.h" static void initData(ModifierData *md) @@ -210,6 +212,17 @@ static void panelRegister(ARegionType *region_type) modifier_panel_register(region_type, eModifierType_Surface, panel_draw); } +static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) +{ + SurfaceModifierData *surmd = (SurfaceModifierData *)md; + + surmd->mesh = NULL; + surmd->bvhtree = NULL; + surmd->x = NULL; + surmd->v = NULL; + surmd->numverts = 0; +} + ModifierTypeInfo modifierType_Surface = { /* name */ "Surface", /* structName */ "SurfaceModifierData", @@ -242,5 +255,5 @@ ModifierTypeInfo modifierType_Surface = { /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendRead */ blendRead, }; |