diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2019-12-09 21:10:55 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2019-12-09 21:18:10 +0300 |
commit | 62ef59aa0cca736b09192b67cc924180d9c2f9f9 (patch) | |
tree | f0f76383b9536a5186abe0072b1a535e587cef22 /source/blender/blenloader/intern/versioning_280.c | |
parent | e77fdc62b75a3b96e4c3ca5c2fc4025d8091ff99 (diff) |
Add the ability to create internal springs to the cloth sim
This can be used to make closed surfaces behave more like a soft body.
Reviewed By: Jacques Lucke
Differential Revision: http://developer.blender.org/D5788
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 6c8b14ad5c7..5c7fda67ff0 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -4268,5 +4268,19 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) { /* Versioning code until next subversion bump goes here. */ + /* Cloth internal springs */ + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { + for (ModifierData *md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Cloth) { + ClothModifierData *clmd = (ClothModifierData *)md; + + clmd->sim_parms->internal_tension = 15.0f; + clmd->sim_parms->max_internal_tension = 15.0f; + clmd->sim_parms->internal_compression = 15.0f; + clmd->sim_parms->max_internal_compression = 15.0f; + clmd->sim_parms->internal_spring_max_diversion = M_PI / 4.0f; + } + } + } } } |