[Bf-blender-cvs] [4ceea37] master: Fix T46481: Volume grid particles out of volume
Sergey Sharybin
noreply at git.blender.org
Tue Feb 2 13:56:53 CET 2016
Commit: 4ceea37db4857c3d87624b15087c5dde5261311d
Author: Sergey Sharybin
Date: Tue Feb 2 13:54:53 2016 +0100
Branches: master
https://developer.blender.org/rB4ceea37db4857c3d87624b15087c5dde5261311d
Fix T46481: Volume grid particles out of volume
The issue was caused by fix for 31017 which resulted in some
missing intersecitons recorded which screwed inner/outer checks.
This is an old bug, so didn't bother with forcing re-distribution
to happen on file open to avoid possible other regressions.
===================================================================
M source/blender/blenkernel/intern/particle_distribute.c
===================================================================
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 9f60cbb..2527ff5 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -220,13 +220,15 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
copy_v3_v3(v2, mvert[mface->v2].co);
copy_v3_v3(v3, mvert[mface->v3].co);
- if (isect_axial_line_segment_tri_v3(a, co1, co2, v2, v3, v1, &lambda)) {
+ bool intersects_tri = isect_axial_line_segment_tri_v3(a, co1, co2, v2, v3, v1, &lambda);
+ if (intersects_tri) {
if (from==PART_FROM_FACE)
(pa+(int)(lambda*size[a])*a0mul)->flag &= ~PARS_UNEXIST;
else /* store number of intersections */
(pa+(int)(lambda*size[a])*a0mul)->hair_index++;
}
- else if (mface->v4) {
+
+ if (mface->v4 && (!intersects_tri || from==PART_FROM_VOLUME)) {
copy_v3_v3(v4, mvert[mface->v4].co);
if (isect_axial_line_segment_tri_v3(a, co1, co2, v4, v1, v3, &lambda)) {
More information about the Bf-blender-cvs
mailing list