[Bf-blender-cvs] [1ea8324] alembic: Actual shape key evaluation in the shape key modifier for caches.
Lukas Tönne
noreply at git.blender.org
Mon May 4 13:05:54 CEST 2015
Commit: 1ea8324a71904a7e5c5be79e2aa441e40abf9e45
Author: Lukas Tönne
Date: Mon May 4 13:04:41 2015 +0200
Branches: alembic
https://developer.blender.org/rB1ea8324a71904a7e5c5be79e2aa441e40abf9e45
Actual shape key evaluation in the shape key modifier for caches.
===================================================================
M source/blender/blenkernel/intern/cache_library.c
===================================================================
diff --git a/source/blender/blenkernel/intern/cache_library.c b/source/blender/blenkernel/intern/cache_library.c
index 22f81a3..5fa0ead 100644
--- a/source/blender/blenkernel/intern/cache_library.c
+++ b/source/blender/blenkernel/intern/cache_library.c
@@ -1242,17 +1242,33 @@ static void strandskey_foreach_id_link(StrandsKeyCacheModifier *skmd, CacheLibra
walk(userdata, cachelib, &skmd->modifier, (ID **)(&skmd->object));
}
-static void strandskey_process(StrandsKeyCacheModifier *skmd, CacheProcessContext *UNUSED(ctx), CacheProcessData *data, int frame, int frame_prev, eCacheLibrary_EvalMode UNUSED(eval_mode))
+static void strandskey_process(StrandsKeyCacheModifier *skmd, CacheProcessContext *UNUSED(ctx), CacheProcessData *data, int UNUSED(frame), int UNUSED(frame_prev), eCacheLibrary_EvalMode UNUSED(eval_mode))
{
Object *ob = skmd->object;
Strands *strands;
-
- /* skip first step and potential backward steps */
- if (frame <= frame_prev)
- return;
+ KeyBlock *actkb;
+ float *shape;
if (!BKE_cache_modifier_find_strands(data->dupcache, ob, skmd->hair_system, NULL, &strands))
return;
+
+ actkb = BLI_findlink(&skmd->key->block, skmd->shapenr);
+ shape = BKE_key_evaluate_strands(strands, skmd->key, actkb, skmd->flag & eStrandsKeyCacheModifier_Flag_ShapeLock, NULL);
+ if (shape) {
+ StrandsVertex *vert = strands->verts;
+ int totvert = strands->totverts;
+ int i;
+
+ float *fp = shape;
+ for (i = 0; i < totvert; ++i) {
+ copy_v3_v3(vert->co, fp);
+
+ fp += 3;
+ ++vert;
+ }
+
+ MEM_freeN(shape);
+ }
}
CacheModifierTypeInfo cacheModifierType_StrandsKey = {
More information about the Bf-blender-cvs
mailing list