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:
@@ -3017,6 +3017,8 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
|
||||
{
|
||||
ParticleSettings *part;
|
||||
ParticleDupliWeight *dw;
|
||||
MTex *mtex;
|
||||
int a;
|
||||
|
||||
part= main->particle.first;
|
||||
while(part) {
|
||||
@@ -3062,6 +3064,15 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(a=0; a<MAX_MTEX; a++) {
|
||||
mtex= part->mtex[a];
|
||||
if(mtex) {
|
||||
mtex->tex = newlibadr_us(fd, part->id.lib, mtex->tex);
|
||||
mtex->object = newlibadr(fd, part->id.lib, mtex->object);
|
||||
}
|
||||
}
|
||||
|
||||
part->id.flag -= LIB_NEEDLINK;
|
||||
}
|
||||
part= part->id.next;
|
||||
@@ -3075,6 +3086,7 @@ static void direct_link_partdeflect(PartDeflect *pd)
|
||||
|
||||
static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
|
||||
{
|
||||
int a;
|
||||
part->adt= newdataadr(fd, part->adt);
|
||||
part->pd= newdataadr(fd, part->pd);
|
||||
part->pd2= newdataadr(fd, part->pd2);
|
||||
@@ -3102,6 +3114,9 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
|
||||
link_list(fd, &state->actions);
|
||||
}
|
||||
}
|
||||
for(a=0; a<MAX_MTEX; a++) {
|
||||
part->mtex[a]= newdataadr(fd, part->mtex[a]);
|
||||
}
|
||||
}
|
||||
|
||||
static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase *particles)
|
||||
@@ -6576,7 +6591,6 @@ static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype)
|
||||
mtex->lifefac= (neg & MAP_PA_LIFE)? -varfac: varfac;
|
||||
mtex->sizefac= (neg & MAP_PA_SIZE)? -varfac: varfac;
|
||||
mtex->ivelfac= (neg & MAP_PA_IVEL)? -varfac: varfac;
|
||||
mtex->pvelfac= (neg & MAP_PA_PVEL)? -varfac: varfac;
|
||||
|
||||
mtex->shadowfac= (neg & LAMAP_SHAD)? -colfac: colfac;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user