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:
authorMatt Ebb <matt@mke3.net>2009-12-11 03:09:58 +0300
committerMatt Ebb <matt@mke3.net>2009-12-11 03:09:58 +0300
commit98dff9b1c71b6936621641897589f1fb59220312 (patch)
tree851835e56c7a1acc1f5bfa67590c173257deaf48
parent8b32402f381e22928390188144b1ab89aac55cd4 (diff)
For for [#20330] Can't open a file made in 2.49
Hair clothsim internal_friction wasn't being initialised correctly.
-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! */