From 29448bd99bb05ae61e4d540981026bab87702f90 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 23 Jun 2016 07:53:49 +1000 Subject: Fix T48658: Cycles render & render preview corrupts particles Replaces `G.is_rendering` with `use_render_params` argument. This is needed for Cycles, which attempts to restore render-preview settings from particles, after it gets its own particle data, but fails to restore because `G.is_rendering` was being checked in psys_cache_paths (and other places). --- source/blender/blenkernel/BKE_particle.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source/blender/blenkernel/BKE_particle.h') diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index e17fb9f7a02..5daa94c4302 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -148,7 +148,8 @@ typedef struct ParticleThreadContext { struct ParticleData *tpars; /* path caching */ - int editupdate, between, segments, extra_segments; + bool editupdate; + int between, segments, extra_segments; int totchild, totparent, parent_pass; float cfra; @@ -293,7 +294,7 @@ void psys_set_current_num(Object *ob, int index); struct LatticeDeformData *psys_create_lattice_deform_data(struct ParticleSimulationData *sim); bool psys_in_edit_mode(struct Scene *scene, struct ParticleSystem *psys); -bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys); +bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params); bool psys_check_edited(struct ParticleSystem *psys); void psys_check_group_weights(struct ParticleSettings *part); @@ -327,11 +328,11 @@ void BKE_particlesettings_make_local(struct ParticleSettings *part); void psys_reset(struct ParticleSystem *psys, int mode); -void psys_find_parents(struct ParticleSimulationData *sim); +void psys_find_parents(struct ParticleSimulationData *sim, const bool use_render_params); -void psys_cache_paths(struct ParticleSimulationData *sim, float cfra); -void psys_cache_edit_paths(struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra); -void psys_cache_child_paths(struct ParticleSimulationData *sim, float cfra, int editupdate); +void psys_cache_paths(struct ParticleSimulationData *sim, float cfra, const bool use_render_params); +void psys_cache_edit_paths(struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra, const bool use_render_params); +void psys_cache_child_paths(struct ParticleSimulationData *sim, float cfra, const bool editupdate, const bool use_render_params); int do_guides(struct ParticleSettings *part, struct ListBase *effectors, ParticleKey *state, int pa_num, float time); void precalc_guides(struct ParticleSimulationData *sim, struct ListBase *effectors); float psys_get_timestep(struct ParticleSimulationData *sim); @@ -379,7 +380,7 @@ void psys_check_boid_data(struct ParticleSystem *psys); void psys_get_birth_coords(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra); -void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys); +void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, const bool use_render_params); /* Callback format for performing operations on ID-pointers for particle systems */ typedef void (*ParticleSystemIDFunc)(struct ParticleSystem *psys, struct ID **idpoin, void *userdata, int cd_flag); -- cgit v1.2.3