diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2007-09-18 11:16:57 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2007-09-18 11:16:57 +0400 |
commit | 9dbcffadec1b537e68435d01e5b632d4763a7150 (patch) | |
tree | 18c5ccf6996e36ee0acb1d6107218047d5f8d5c2 /source/blender/blenloader/intern | |
parent | f473f4ee7987e9f2d66c5f0821bb826ab194a082 (diff) |
Temporary fix for loading crash of .blends with cached frames. Also fixed some goal behavior/init problem to match SB behaviour
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 29 |
2 files changed, 31 insertions, 8 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 19f74096e54..3fbfef12f1f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2878,11 +2878,13 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) ClothModifierData *clmd = (ClothModifierData*) md; clmd->clothObject = NULL; - /* - if (clmd->sim_parms.flags & CSIMSETT_FLAG_BAKED) { - clmd->baked_data = newdataadr (fd, clmd->baked_data); + clmd->sim_parms.cache = NULL; + + if (clmd->sim_parms.cache) { + // TODO + // clmd->cache = newdataadr (fd, clmd->cache); printf ("direct_link_modifiers: read cloth baked_data.\n"); - }*/ + } } 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 4203824ae65..0a0c49c5ef8 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -813,6 +813,23 @@ static void write_constraint_channels(WriteData *wd, ListBase *chanbase) } +/* +// TODO: finish this +static void write_cloth_cache(WriteData *wd, LinkNode *ln) +{ + + while(ln) { + writestruct(wd, DATA, "cloth_cache", 1, ln); + writestruct(wd, DATA, "cloth_cache_frame", 1, ln->link); + writestruct(wd, DATA, "cloth_cache_frame_verts", 1, ln->link); + writestruct(wd, DATA, "cloth_cache_frame_springs", 1, ln->link); + } + + ln = ln->next; + } +} +*/ + static void write_modifiers(WriteData *wd, ListBase *modbase) { ModifierData *md; @@ -832,16 +849,20 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) else if (md->type==eModifierType_Cloth) { int n; ClothModifierData *clmd = (ClothModifierData *) md; - /* - if ((clmd->sim_parms.flags & CSIMSETT_FLAG_BAKED) && clmd->baked_data) { + + if (clmd->sim_parms.cache) { // Compute the number of vertices we're saving. - + // TODO + // write_cloth_cache(); + /* + // old code n = (clmd->sim_parms.bake_end_frame - clmd->sim_parms.bake_start_frame + 1) * clmd->sim_parms.bake_num_verts; writedata (wd, DATA, n * sizeof (clmd->baked_data [0]), clmd->baked_data); printf ("write_modifiers: wrote %d elements of size %d for cloth baked data.\n", n, sizeof (clmd->baked_data [0])); - }*/ + */ + } } } } |