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:
authorLukas Tönne <lukas.toenne@gmail.com>2015-02-12 12:15:25 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-02-12 12:15:25 +0300
commitb2b54b0902045ec4f0c1a4cae3209be863878f5b (patch)
treee72fc914623335eda421630a55190b6621d0bfc4 /source/blender/blenkernel/intern/particle_system.c
parenta9d09ff7ae36198dc21fd199a44d638bad859852 (diff)
Fix T43471, based on patch submitted by @sean_loh.
Particle textures always override timing information of particles. Previously particle times could be scripted, but now these changes are discarded by the texture evaluation function. The patch disables texture overriding when no textures are defined, this way at least some old scripts can keep working.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 04181606796..4a1573fe88e 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -521,22 +521,25 @@ static void initialize_particle_texture(ParticleSimulationData *sim, ParticleDat
ParticleSystem *psys = sim->psys;
ParticleSettings *part = psys->part;
ParticleTexture ptex;
+ bool has_texture = false;
- psys_get_texture(sim, pa, &ptex, PAMAP_INIT, 0.f);
+ has_texture = psys_get_texture(sim, pa, &ptex, PAMAP_INIT, 0.f);
- switch (part->type) {
- case PART_EMITTER:
- if (ptex.exist < psys_frand(psys, p+125))
- pa->flag |= PARS_UNEXIST;
- pa->time = part->sta + (part->end - part->sta)*ptex.time;
- break;
- case PART_HAIR:
- if (ptex.exist < psys_frand(psys, p+125))
- pa->flag |= PARS_UNEXIST;
- pa->time = 0.f;
- break;
- case PART_FLUID:
- break;
+ if (has_texture) {
+ switch (part->type) {
+ case PART_EMITTER:
+ if (ptex.exist < psys_frand(psys, p+125))
+ pa->flag |= PARS_UNEXIST;
+ pa->time = part->sta + (part->end - part->sta)*ptex.time;
+ break;
+ case PART_HAIR:
+ if (ptex.exist < psys_frand(psys, p+125))
+ pa->flag |= PARS_UNEXIST;
+ pa->time = 0.f;
+ break;
+ case PART_FLUID:
+ break;
+ }
}
}
@@ -969,6 +972,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
ParticleSettings *part;
ParticleTexture ptex;
int p = pa - psys->particles;
+
part=psys->part;
/* get precise emitter matrix if particle is born */