Particles todo item: particle textures

* Effecting particle properties with textures was possible in 2.49,
  but not in 2.5 anymore.
* Now particles have their own textures (available in texture panel
  for objects with particle systems), which are totally separate from
  the material textures.
* Currently a basic set of particle properties is available for
  texture control. Some others could still be added, but the whole
  system is not intended as an "change anything with a texture" as
  this kind of functionality will be provided with node particles in
  the future much better.
* Combined with the previously added "particle texture coordinates"
  this new functionality also solves the problem of animating particle
  properties through the particle lifetime nicely.
* Currently the textures only use the intensity of the texture in
  "multiply" blending mode, so in order for the textures to effect
  a particle parameter there has to be a non-zero value defined for
  the parameter in the particle settings. Other blend modes can be
  added later if they're considered useful enough.
This commit is contained in:
2011-02-12 14:38:34 +00:00
parent c8c86aa6a1
commit fafbd9d71b
19 changed files with 726 additions and 386 deletions

View File

@@ -40,6 +40,7 @@
#include "DNA_group_types.h"
#include "DNA_lattice_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
@@ -2375,6 +2376,29 @@ static void dag_id_flush_update(Scene *sce, ID *id)
modifiers_foreachIDLink(obt, dag_id_flush_update__isDependentTexture, &data);
if (data.is_dependent)
obt->recalc |= OB_RECALC_DATA;
/* particle settings can use the texture as well */
if(obt->particlesystem.first) {
ParticleSystem *psys = obt->particlesystem.first;
MTex **mtexp, *mtex;
int a;
for(; psys; psys=psys->next) {
mtexp = psys->part->mtex;
for(a=0; a<MAX_MTEX; a++, mtexp++) {
mtex = *mtexp;
if(mtex && mtex->tex == (Tex*)id) {
obt->recalc |= OB_RECALC_DATA;
if(mtex->mapto & PAMAP_INIT)
psys->recalc |= PSYS_RECALC_RESET;
if(mtex->mapto & PAMAP_CHILD)
psys->recalc |= PSYS_RECALC_CHILD;
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
}
}
}
}
}
}