[Bf-blender-cvs] [cfca827] temp_hair_modifiers: Update the world space location of final hair keys after applying modifiers.
Lukas Tönne
noreply at git.blender.org
Mon Feb 2 17:29:51 CET 2015
Commit: cfca82780844c21d500bf9861d6a54dfbdf0a350
Author: Lukas Tönne
Date: Mon Feb 2 16:56:30 2015 +0100
Branches: temp_hair_modifiers
https://developer.blender.org/rBcfca82780844c21d500bf9861d6a54dfbdf0a350
Update the world space location of final hair keys after applying
modifiers.
===================================================================
M source/blender/blenkernel/intern/particle_system.c
===================================================================
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 11e696a..d87a58e 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2928,6 +2928,21 @@ static void psys_hair_calc_final(ParticleSimulationData *sim)
if (shapekey_data)
MEM_freeN(shapekey_data);
}
+
+ /* update world space location */
+ {
+ for (p = 0, pa = psys->particles; p < psys->totpart; ++p, ++pa) {
+ HairKey *key;
+ int k;
+ float hairmat[4][4];
+
+ psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat);
+
+ for (k = 0, key = pa->hair_final; k < pa->totkey_final; ++k, ++key) {
+ mul_v3_m4v3(key->world_co, hairmat, key->co);
+ }
+ }
+ }
}
static bool psys_needs_path_cache(ParticleSimulationData *sim)
More information about the Bf-blender-cvs
mailing list