From 35c93b07bd18590b4b80acc8c8a6adf1d6f122c1 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 22 Jan 2008 20:28:12 +0000 Subject: GUI cloth panel refactor, also made many code rearrangements, cleared DNA up --- source/blender/blenloader/intern/readfile.c | 36 ++++++++++++++++++---------- source/blender/blenloader/intern/writefile.c | 15 ++++++++++-- 2 files changed, 37 insertions(+), 14 deletions(-) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index af75e9490d5..c725b3d63ac 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2998,29 +2998,41 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) SubsurfModifierData *smd = (SubsurfModifierData*) md; smd->emCache = smd->mCache = 0; - } + } else if (md->type==eModifierType_Cloth) { - ClothModifierData *clmd = (ClothModifierData*) md; - - clmd->clothObject = NULL; - /* - clmd->sim_parms= newdataadr(fd, clmd->sim_parms); - clmd->coll_parms= newdataadr(fd, clmd->coll_parms); - */ - - } + ClothModifierData *clmd = (ClothModifierData*) md; + + clmd->clothObject = NULL; + + clmd->sim_parms= newdataadr(fd, clmd->sim_parms); + clmd->coll_parms= newdataadr(fd, clmd->coll_parms); + + } else if (md->type==eModifierType_Collision) { - /* + CollisionModifierData *collmd = (CollisionModifierData*) md; + /* + // 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_callocN(sizeof(MVert)*collmd->numverts,"current_x"); + collmd->current_xnew = MEM_callocN(sizeof(MVert)*collmd->numverts,"current_xnew"); + collmd->current_v = MEM_callocN(sizeof(MVert)*collmd->numverts,"current_v"); + */ collmd->x = NULL; collmd->xnew = NULL; collmd->current_x = NULL; collmd->current_xnew = NULL; + collmd->current_v = NULL; collmd->time = -1; collmd->numverts = 0; collmd->tree = NULL; - */ + collmd->mfaces = NULL; + } else if (md->type==eModifierType_Hook) { HookModifierData *hmd = (HookModifierData*) md; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 3ac4160b105..8bcc2497dbd 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -839,11 +839,22 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) } else if(md->type==eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData*) md; - /* + writestruct(wd, DATA, "SimulationSettings", 1, clmd->sim_parms); writestruct(wd, DATA, "CollisionSettings", 1, clmd->coll_parms); - */ + } + else if (md->type==eModifierType_Collision) { + + CollisionModifierData *collmd = (CollisionModifierData*) md; + /* + // TODO: CollisionModifier should use pointcache + // + have proper reset events before enabling this + writestruct(wd, DATA, "MVert", collmd->numverts, collmd->x); + writestruct(wd, DATA, "MVert", collmd->numverts, collmd->xnew); + writestruct(wd, DATA, "MFace", collmd->numfaces, collmd->mfaces); + */ + } else if (md->type==eModifierType_MeshDeform) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; int size = mmd->dyngridsize; -- cgit v1.2.3