[Bf-blender-cvs] [3e16951] alembic_pointcache: Fix for particle pathcache caching: have to check the psys->renderdata pointer to figure out if we are evaluating with render settings.

Lukas Tönne noreply at git.blender.org
Mon Mar 9 17:42:54 CET 2015


Commit: 3e16951ec67d3203d7fbb24ab076a7394a3d2a2e
Author: Lukas Tönne
Date:   Mon Mar 9 15:51:59 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB3e16951ec67d3203d7fbb24ab076a7394a3d2a2e

Fix for particle pathcache caching: have to check the psys->renderdata
pointer to figure out if we are evaluating with render settings.

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

M	source/blender/blenkernel/intern/particle.c

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

diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 87db639..08aa9a1 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2322,7 +2322,8 @@ static void exec_child_path_cache(TaskPool *UNUSED(pool), void *taskdata, int UN
 
 void psys_cache_child_paths(ParticleSimulationData *sim, float cfra, int editupdate)
 {
-	const eCacheLibrary_EvalMode cache_eval_mode = (sim->psmd && (sim->psmd->modifier.mode & eModifierMode_Render)) ? CACHE_LIBRARY_EVAL_RENDER : CACHE_LIBRARY_EVAL_VIEWPORT;
+	const bool use_render = (sim->psys->renderdata != NULL);
+	const eCacheLibrary_EvalMode cache_eval_mode = use_render ? CACHE_LIBRARY_EVAL_RENDER : CACHE_LIBRARY_EVAL_VIEWPORT;
 	TaskScheduler *task_scheduler;
 	TaskPool *task_pool;
 	ParticleThreadContext ctx;
@@ -2437,7 +2438,8 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache
  * - Cached path data is also used to determine cut position for the editmode tool. */
 void psys_cache_paths(ParticleSimulationData *sim, float cfra)
 {
-	const eCacheLibrary_EvalMode cache_eval_mode = (sim->psmd && (sim->psmd->modifier.mode & eModifierMode_Render)) ? CACHE_LIBRARY_EVAL_RENDER : CACHE_LIBRARY_EVAL_VIEWPORT;
+	const bool use_render = (sim->psys->renderdata != NULL);
+	const eCacheLibrary_EvalMode cache_eval_mode = use_render ? CACHE_LIBRARY_EVAL_RENDER : CACHE_LIBRARY_EVAL_VIEWPORT;
 	PARTICLE_PSMD;
 	ParticleEditSettings *pset = &sim->scene->toolsettings->particle;
 	ParticleSystem *psys = sim->psys;




More information about the Bf-blender-cvs mailing list