diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_collision.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_collision.c | 32 |
1 files changed, 31 insertions, 1 deletions
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, }; |