[Bf-blender-cvs] [548102f] alembic: Version fix for bend stiffness curve mapping.

Lukas Tönne noreply at git.blender.org
Fri May 8 11:13:25 CEST 2015


Commit: 548102fcb8d2b8661233af1af3cc85a7946c263a
Author: Lukas Tönne
Date:   Fri May 8 11:13:04 2015 +0200
Branches: alembic
https://developer.blender.org/rB548102fcb8d2b8661233af1af3cc85a7946c263a

Version fix for bend stiffness curve mapping.

===================================================================

M	source/blender/blenloader/intern/versioning_270.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index df98544..1c9e979 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -36,6 +36,7 @@
 #define DNA_DEPRECATED_ALLOW
 
 #include "DNA_brush_types.h"
+#include "DNA_cache_library_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_cloth_types.h"
 #include "DNA_constraint_types.h"
@@ -54,6 +55,7 @@
 
 #include "DNA_genfile.h"
 
+#include "BKE_colortools.h"
 #include "BKE_main.h"
 #include "BKE_modifier.h"
 #include "BKE_node.h"
@@ -831,4 +833,24 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 			}
 		}
 	}
+
+	if (!DNA_struct_elem_find(fd->filesdna, "HairSimParams", "CurveMapping", "bend_stiffness_mapping")) {
+		CacheLibrary *cachelib;
+		for (cachelib = main->cache_library.first; cachelib; cachelib = cachelib->id.next) {
+			CacheModifier *md;
+			for (md = cachelib->modifiers.first; md; md = md->next) {
+				if (md->type == eCacheModifierType_HairSimulation) {
+					HairSimCacheModifier *hsmd = (HairSimCacheModifier *)md;
+					{
+						CurveMapping *cm = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+						cm->cm[0].curve[0].x = 0.0f;
+						cm->cm[0].curve[0].y = 1.0f;
+						cm->cm[0].curve[1].x = 1.0f;
+						cm->cm[0].curve[1].y = 1.0f;
+						hsmd->sim_params.bend_stiffness_mapping = cm;
+					}
+				}
+			}
+		}
+	}
 }




More information about the Bf-blender-cvs mailing list