Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-25 02:41:40 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-25 02:41:40 +0400
commit454d6e020700195b191e6ff109d8ed0eccdf0254 (patch)
tree67e2eb3dce55b031ada08225b38f655a6a0db3f4 /source/blender/blenkernel/intern/particle_system.c
parent28dd9c6a40859bf8d707b072174557d37240f162 (diff)
Fix particle hair display percentage not properly getting restored after
rendering. This used to happen in an unneeded frame change update which was removed. For heavy particle systems this could have a bad impact on viewport performance after rendering.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 50d2a47a97f..ec45c9eef40 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -123,7 +123,7 @@ static int particles_are_dynamic(ParticleSystem *psys)
return ELEM3(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID);
}
-static int psys_get_current_display_percentage(ParticleSystem *psys)
+float psys_get_current_display_percentage(ParticleSystem *psys)
{
ParticleSettings *part=psys->part;
@@ -131,10 +131,10 @@ static int psys_get_current_display_percentage(ParticleSystem *psys)
(part->child_nbr && part->childtype) || /* display percentage applies to children */
(psys->pointcache->flag & PTCACHE_BAKING)) /* baking is always done with full amount */
{
- return 100;
+ return 1.0f;
}
- return psys->part->disp;
+ return psys->part->disp/100.0f;
}
static int tot_particles(ParticleSystem *psys, PTCacheID *pid)
@@ -3984,7 +3984,7 @@ static void hair_step(ParticleSimulationData *sim, float cfra)
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
PARTICLE_P;
- float disp = (float)psys_get_current_display_percentage(psys)/100.0f;
+ float disp = psys_get_current_display_percentage(psys);
LOOP_PARTICLES {
pa->size = part->size;
@@ -4388,7 +4388,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
psys_update_effectors(sim);
- disp= (float)psys_get_current_display_percentage(psys)/100.0f;
+ disp= psys_get_current_display_percentage(psys);
LOOP_PARTICLES {
psys_get_texture(sim, pa, &ptex, PAMAP_SIZE, cfra);
@@ -4637,7 +4637,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
/* 3. do dynamics */
/* set particles to be not calculated TODO: can't work with pointcache */
- disp= (float)psys_get_current_display_percentage(psys)/100.0f;
+ disp= psys_get_current_display_percentage(psys);
LOOP_PARTICLES {
if (PSYS_FRAND(p) > disp)
@@ -4933,7 +4933,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
case PART_PHYS_KEYED:
{
PARTICLE_P;
- float disp = (float)psys_get_current_display_percentage(psys)/100.0f;
+ float disp = psys_get_current_display_percentage(psys);
/* Particles without dynamics haven't been reset yet because they don't use pointcache */
if (psys->recalc & PSYS_RECALC_RESET)