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:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-01-25 13:33:19 +0300
committerDaniel Genrich <daniel.genrich@gmx.net>2008-01-25 13:33:19 +0300
commit589870100dc6734a20c99f572baeb2c401e6509f (patch)
treeb9fd983090dd7fcdfec31ef74d7f8c2a59a78531 /source/blender/blenkernel/intern/cloth.c
parente7f5d077810004467066d627f34d433a61e68fb2 (diff)
Fix: clear cache button works again even with protected cache, edited cache doesn't get saved to wrong frame anymore when moving frames forward in editmode
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r--source/blender/blenkernel/intern/cloth.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 70c6857f14b..e1b97362e08 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -145,9 +145,9 @@ void cloth_init ( ClothModifierData *clmd )
clmd->sim_parms->gravity [0] = 0.0;
clmd->sim_parms->gravity [1] = 0.0;
clmd->sim_parms->gravity [2] = -9.81;
- clmd->sim_parms->structural = 100.0;
- clmd->sim_parms->shear = 100.0;
- clmd->sim_parms->bending = 1.0;
+ clmd->sim_parms->structural = 200.0;
+ clmd->sim_parms->shear = 200.0;
+ clmd->sim_parms->bending = 0.1;
clmd->sim_parms->Cdis = 5.0;
clmd->sim_parms->Cvi = 1.0;
clmd->sim_parms->mass = 1.0f;
@@ -161,6 +161,7 @@ void cloth_init ( ClothModifierData *clmd )
clmd->sim_parms->lastframe = 250;
clmd->sim_parms->vgroup_mass = 0;
clmd->sim_parms->lastcachedframe = 0;
+ clmd->sim_parms->editedframe = 0;
clmd->coll_parms->self_friction = 5.0;
clmd->coll_parms->friction = 10.0;
@@ -485,7 +486,7 @@ DerivedMesh *CDDM_create_tearing ( ClothModifierData *clmd, DerivedMesh *dm )
int modifiers_indexInObject(Object *ob, ModifierData *md_seek);
-static int cloth_read_cache(Object *ob, ClothModifierData *clmd, float framenr)
+int cloth_read_cache(Object *ob, ClothModifierData *clmd, float framenr)
{
FILE *fp = NULL;
int stack_index = -1;
@@ -534,7 +535,7 @@ void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
int stack_index = -1;
/* clear cache if specific frame cleaning requested or cache is not protected */
- if((!(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_CCACHE_PROTECT)) || (framenr > 1.0))
+ if((!(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_CCACHE_PROTECT)) || (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_CCACHE_FFREE))
{
stack_index = modifiers_indexInObject(ob, (ModifierData *)clmd);
@@ -545,6 +546,9 @@ void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
{
cloth_read_cache(ob, clmd, framenr);
}
+
+ /* delete cache free request */
+ clmd->sim_parms->flags &= ~CLOTH_SIMSETTINGS_FLAG_CCACHE_FFREE;
}
void cloth_write_cache(Object *ob, ClothModifierData *clmd, float framenr)
{