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:
-rw-r--r--source/blender/blenkernel/intern/cloth.c1
-rw-r--r--source/blender/blenloader/intern/readfile.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 6c4c7daea7f..dc9a70f2767 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -154,6 +154,7 @@ void cloth_init ( ClothModifierData *clmd )
clmd->sim_parms->defgoal = 0.0f;
clmd->sim_parms->goalspring = 1.0f;
clmd->sim_parms->goalfrict = 0.0f;
+ clmd->sim_parms->velocity_smooth = 0.0f;
if(!clmd->sim_parms->effector_weights)
clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 860225b7dc3..eada820ba89 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10184,6 +10184,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->toolsettings->particle.selectmode= SCE_SELECT_PATH;
}
+ {
+ Object *ob;
+
+ /* properly initialise hair clothsim data on old files */
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ ModifierData *md;
+ for(md= ob->modifiers.first; md; md= md->next) {
+ if (md->type == eModifierType_Cloth) {
+ ClothModifierData *clmd = (ClothModifierData *)md;
+ if (clmd->sim_parms->velocity_smooth < 0.01f)
+ clmd->sim_parms->velocity_smooth = 0.f;
+ }
+ }
+ }
+ }
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */