Commit: 5e9ad8065a19219f63ff9af86b920f181cf3bac2
Author: Luca Rood
Date:   Wed Jul 5 16:16:57 2017 +0200
Branches: master
https://developer.blender.org/rB5e9ad8065a19219f63ff9af86b920f181cf3bac2

Code comments regarding last commit (forgotten to add before)

Using an arbitrary face as the source of the UV data is mostly fine, as
vertices on seams will generally map to different parts of the texture
that have the same color.

This is regarding fed853ea782211298c902759ec8cd8e455d8b41d

===================================================================

M       source/blender/blenkernel/intern/particle.c
M       source/blender/blenkernel/intern/particle_distribute.c
M       source/blender/makesrna/intern/rna_particle.c

===================================================================

diff --git a/source/blender/blenkernel/intern/particle.c 
b/source/blender/blenkernel/intern/particle.c
index e101bd64931..416d63cfefb 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3410,6 +3410,9 @@ static int get_particle_uv(DerivedMesh *dm, ParticleData 
*pa, int index, const f
                if (from_vert) {
                        mf = dm->getTessFaceDataArray(dm, CD_MFACE);
 
+                       /* This finds the first face to contain the emitting 
vertex,
+                        * this is not ideal, but is mostly fine as UV seams 
generally
+                        * map to equal-colored parts of a texture */
                        for (int j = 0; j < dm->getNumTessFaces(dm); j++, mf++) 
{
                                if (ELEM(i, mf->v1, mf->v2, mf->v3, mf->v4)) {
                                        i = j;
diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 09da5fe7245..4f758bde7f9 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -440,6 +440,10 @@ static void distribute_from_verts_exec(ParticleTask 
*thread, ParticleData *pa, i
        zero_v4(pa->fuv);
 
        if (pa->num != DMCACHE_NOTFOUND && pa->num < 
ctx->dm->getNumVerts(ctx->dm)) {
+
+               /* This finds the first face to contain the emitting vertex,
+                * this is not ideal, but is mostly fine as UV seams generally
+                * map to equal-colored parts of a texture */
                for (int i = 0; i < ctx->dm->getNumTessFaces(ctx->dm); i++, 
mface++) {
                        if (ELEM(pa->num, mface->v1, mface->v2, mface->v3, 
mface->v4)) {
                                unsigned int *vert = &mface->v1;
diff --git a/source/blender/makesrna/intern/rna_particle.c 
b/source/blender/makesrna/intern/rna_particle.c
index 0dac797824d..00104b8667d 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -492,6 +492,9 @@ static int 
rna_ParticleSystem_tessfaceidx_on_emitter(ParticleSystem *particlesys
 
                                *r_fuv = &particle->fuv;
 
+                               /* This finds the first face to contain the 
emitting vertex,
+                                * this is not ideal, but is mostly fine as UV 
seams generally
+                                * map to equal-colored parts of a texture */
                                for (int i = 0; i < totface; i++, mface++) {
                                        if (ELEM(num, mface->v1, mface->v2, 
mface->v3, mface->v4)) {
                                                return i;
@@ -531,6 +534,9 @@ static int 
rna_ParticleSystem_tessfaceidx_on_emitter(ParticleSystem *particlesys
 
                                        *r_fuv = &parent->fuv;
 
+                                       /* This finds the first face to contain 
the emitting vertex,
+                                        * this is not ideal, but is mostly 
fine as UV seams generally
+                                        * map to equal-colored parts of a 
texture */
                                        for (int i = 0; i < totface; i++, 
mface++) {
                                                if (ELEM(num, mface->v1, 
mface->v2, mface->v3, mface->v4)) {
                                                        return i;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to