[Bf-blender-cvs] [a67658d] alembic: Only process hair simulation in "realtime" mode.

Lukas Tönne noreply at git.blender.org
Thu Apr 16 12:11:14 CEST 2015


Commit: a67658dddc0cb0e16dbb293cac1dea19baad1fbd
Author: Lukas Tönne
Date:   Wed Apr 15 12:29:17 2015 +0200
Branches: alembic
https://developer.blender.org/rBa67658dddc0cb0e16dbb293cac1dea19baad1fbd

Only process hair simulation in "realtime" mode.

This means no motion state data is generated for render mode, this
requires some larger changes to the way render/realtime data is stored
in the caches.

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

M	source/blender/blenkernel/BKE_cache_library.h
M	source/blender/blenkernel/intern/cache_library.c

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

diff --git a/source/blender/blenkernel/BKE_cache_library.h b/source/blender/blenkernel/BKE_cache_library.h
index 9184a97..dd9dd64 100644
--- a/source/blender/blenkernel/BKE_cache_library.h
+++ b/source/blender/blenkernel/BKE_cache_library.h
@@ -102,7 +102,8 @@ typedef void (*CacheModifier_FreeFunc)(struct CacheModifier *md);
 typedef void (*CacheModifier_CopyFunc)(struct CacheModifier *md, struct CacheModifier *target);
 typedef void (*CacheModifier_ForeachIDLinkFunc)(struct CacheModifier *md, struct CacheLibrary *cachelib,
                                                 CacheModifier_IDWalkFunc walk, void *userData);
-typedef void (*CacheModifier_ProcessFunc)(struct CacheModifier *md, struct CacheProcessContext *ctx, struct CacheProcessData *data, int frame, int frame_prev);
+typedef void (*CacheModifier_ProcessFunc)(struct CacheModifier *md, struct CacheProcessContext *ctx, struct CacheProcessData *data,
+                                          int frame, int frame_prev, eCacheLibrary_EvalMode eval_mode);
 
 typedef struct CacheModifierTypeInfo {
 	/* The user visible name for this modifier */
diff --git a/source/blender/blenkernel/intern/cache_library.c b/source/blender/blenkernel/intern/cache_library.c
index f86a7ec..bb9cb5d 100644
--- a/source/blender/blenkernel/intern/cache_library.c
+++ b/source/blender/blenkernel/intern/cache_library.c
@@ -600,7 +600,7 @@ void BKE_cache_modifier_foreachIDLink(struct CacheLibrary *cachelib, struct Cach
 }
 
 void BKE_cache_process_dupli_cache(CacheLibrary *cachelib, CacheProcessData *data,
-                                   Scene *scene, Group *dupgroup, float frame_prev, float frame, eCacheLibrary_EvalMode UNUSED(eval_mode))
+                                   Scene *scene, Group *dupgroup, float frame_prev, float frame, eCacheLibrary_EvalMode eval_mode)
 {
 	CacheProcessContext ctx;
 	CacheModifier *md;
@@ -614,7 +614,7 @@ void BKE_cache_process_dupli_cache(CacheLibrary *cachelib, CacheProcessData *dat
 		CacheModifierTypeInfo *mti = cache_modifier_type_get(md->type);
 		
 		if (mti->process)
-			mti->process(md, &ctx, data, frame, frame_prev);
+			mti->process(md, &ctx, data, frame, frame_prev, eval_mode);
 	}
 }
 
@@ -707,7 +707,7 @@ static bool hairsim_find_data(HairSimCacheModifier *hsmd, DupliCache *dupcache,
 	return true;
 }
 
-static void hairsim_process(HairSimCacheModifier *hsmd, CacheProcessContext *ctx, CacheProcessData *data, int frame, int frame_prev)
+static void hairsim_process(HairSimCacheModifier *hsmd, CacheProcessContext *ctx, CacheProcessData *data, int frame, int frame_prev, eCacheLibrary_EvalMode eval_mode)
 {
 	Object *ob;
 	Strands *strands;
@@ -715,6 +715,10 @@ static void hairsim_process(HairSimCacheModifier *hsmd, CacheProcessContext *ctx
 	ListBase *effectors;
 	struct Implicit_Data *solver_data;
 	
+	/* only perform hair sim once */
+	if (eval_mode != CACHE_LIBRARY_EVAL_REALTIME)
+		return;
+	
 	/* skip first step and potential backward steps */
 	if (frame <= frame_prev)
 		return;




More information about the Bf-blender-cvs mailing list