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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-02-02 15:54:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-02-02 15:54:53 +0300
commit4ceea37db4857c3d87624b15087c5dde5261311d (patch)
tree60fc27b469417da2a9c98fe664f5e784600997dd /source/blender/blenkernel/intern/particle_distribute.c
parent49247f0fc445ec014478d485883492a04ae5facb (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_distribute.c')
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 9f60cbb88e3..2527ff5e0da 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)) {