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.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.c')
-rw-r--r--source/blender/blenkernel/intern/particle.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 2de5f460da2..72aed1b02f6 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3429,7 +3429,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_ROUGH, ptex->rough1);
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_DENS, ptex->exist);
}
-void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTexture *ptex, int event, float cfra)
+bool psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTexture *ptex, int event, float cfra)
{
Object *ob = sim->ob;
Mesh *me = (Mesh *)ob->data;
@@ -3439,6 +3439,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
int m;
float value, rgba[4], co[3], texvec[3];
int setvars = 0;
+ bool has_texture = false;
/* initialize ptex */
ptex->ivel = ptex->life = ptex->exist = ptex->size = ptex->damp =
@@ -3514,6 +3515,8 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
SET_PARTICLE_TEXTURE(PAMAP_GRAVITY, ptex->gravity, mtex->gravityfac);
SET_PARTICLE_TEXTURE(PAMAP_DAMP, ptex->damp, mtex->dampfac);
SET_PARTICLE_TEXTURE(PAMAP_LENGTH, ptex->length, mtex->lengthfac);
+
+ has_texture = true;
}
}
@@ -3526,6 +3529,8 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
CLAMP_PARTICLE_TEXTURE_POSNEG(PAMAP_GRAVITY, ptex->gravity);
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_DAMP, ptex->damp);
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_LENGTH, ptex->length);
+
+ return has_texture;
}
/************************************************/
/* Particle State */