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:
authorCampbell Barton <ideasman42@gmail.com>2015-03-28 20:44:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-03-31 02:20:11 +0300
commitc16a8983efba9ecacd8da408d03c37a55483e528 (patch)
treebfeb0f644ac3bd8782bef474329e5a991c82d08c /source/blender/blenloader
parent660173ed72d9c69f6891d5ad05a8c4a35ece9c7c (diff)
Corrective Smooth Modifier (aka delta-mush)
This modifier can be used to correct bad deformations, Original patch D1183 by @sazerac, with own modifications
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c14
-rw-r--r--source/blender/blenloader/intern/writefile.c7
2 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b8c3bffae0f..b0aa47787b6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4949,6 +4949,20 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
}
lmd->cache_system = NULL;
}
+ else if (md->type == eModifierType_CorrectiveSmooth) {
+ CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData*)md;
+
+ if (csmd->bind_coords) {
+ csmd->bind_coords = newdataadr(fd, csmd->bind_coords);
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ BLI_endian_switch_float_array((float *)csmd->bind_coords, csmd->bind_coords_num * 3);
+ }
+ }
+
+ /* runtime only */
+ csmd->delta_cache = NULL;
+ csmd->delta_cache_num = 0;
+ }
}
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index bc1bc9c7759..afc53f343f1 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1620,6 +1620,13 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
writedata(wd, DATA, sizeof(float)*lmd->total_verts * 3, lmd->vertexco);
}
+ else if (md->type == eModifierType_CorrectiveSmooth) {
+ CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)md;
+
+ if (csmd->bind_coords) {
+ writedata(wd, DATA, sizeof(float[3]) * csmd->bind_coords_num, csmd->bind_coords);
+ }
+ }
}
}