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-23 12:03:46 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-02-23 12:03:46 +0300
commite93ec66dd0d61f42cf2ba0551c82dfcf4aa8ff5f (patch)
tree72d883f13f7d19aece41955e621745ecb7373eaa /source/blender/blenkernel/intern/particle_system.c
parentbdf39274cdf6fe4316f41008e4571d0a99a203ef (diff)
Experimental hair shape key control with textures.
Rationale for this feature goes like this: In meshes the influence of shape keys can be limited to certain vertex groups. This allows shapes to be applied selectively on parts of the mesh and possibly even be animated by changing vertex group weights over time. With hair shape keys there is no equivalent feature to vertex groups (defining a vertex group on hair keys would be rather tedious anyway). It would be possible to use the emitter mesh vgroups to assign a per-strand blending weight, but since hairs usually are much more dense than mesh vertices this would sacrifice accuracy. A better option is to allow textures to influence the hair shape key blending. For this purpose there is now a new texture influence. A shape key name needs to be assigned to the MTex in addition to a factor. It will then act as a multiplier for the shape key weight, i.e. the base shapekey value still works as an overall control.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 4a17e20dbb9..91057e4dcd5 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3167,7 +3167,7 @@ static void hair_create_input_dm(ParticleSimulationData *sim, int totpoint, int
/* XXX placeholder for more flexible future hair settings */
hair_radius = part->size;
- shapekey = shapekey_data = BKE_key_evaluate_particles(sim->ob, psys, &totshapekey);
+ shapekey = shapekey_data = BKE_key_evaluate_particles(sim->ob, psys, sim->scene ? sim->scene->r.cfra : 0.0f, &totshapekey);
/* make vgroup for pin roots etc.. */
hair_index = 1;
@@ -3456,7 +3456,7 @@ static void hair_step(ParticleSimulationData *sim, float cfra)
int totshapekey;
if (part->type == PART_HAIR) {
- shapekey = shapekey_data = BKE_key_evaluate_particles(sim->ob, sim->psys, &totshapekey);
+ shapekey = shapekey_data = BKE_key_evaluate_particles(sim->ob, sim->psys, sim->scene ? sim->scene->r.cfra : 0.0f, &totshapekey);
}
LOOP_PARTICLES {