Merge branch 'master' into blender2.8
authorSybren A. Stüvel <sybren@stuvel.eu>
Wed, 5 Jul 2017 20:25:05 +0000 (22:25 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Wed, 5 Jul 2017 20:25:05 +0000 (22:25 +0200)
intern/cycles/util/util_logging.h
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_distribute.c
source/blender/blenloader/intern/versioning_270.c
source/blender/makesrna/intern/rna_particle.c

index 6380cb13a9ba66df8470d3ae2d175cf3541690cb..492f830e67cc9b29619d985c1a9cda67b7657eeb 100644 (file)
@@ -21,6 +21,8 @@
 #  include <glog/logging.h>
 #endif
 
+#include <iostream>
+
 CCL_NAMESPACE_BEGIN
 
 #if !defined(WITH_CYCLES_LOGGING) || defined(__KERNEL_GPU__)
index f34a680b52da559626fd31f43488d584dc194ec6..a8253b9dc3cf0ad36662f6370509255116b3d0d2 100644 (file)
@@ -3415,6 +3415,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;
index 09da5fe72456bfb6e845e0137434062cdeb93e54..4f758bde7f9d5dfc55159b7d12a6762990407670 100644 (file)
@@ -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;
index db32b48c717029b98a2e2650e3c1f0715e3e2945..cb7c46d24f3ec8157a2802f2c2e5f4e1822628e0 100644 (file)
@@ -1236,12 +1236,19 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 
                        SEQ_BEGIN (scene->ed, seq)
                        {
-                               if (seq->type == SEQ_TYPE_TEXT) {
-                                       TextVars *data = seq->effectdata;
-                                       if (data->color[3] == 0.0f) {
-                                               copy_v4_fl(data->color, 1.0f);
-                                               data->shadow_color[3] = 1.0f;
-                                       }
+                               if (seq->type != SEQ_TYPE_TEXT) {
+                                       continue;
+                               }
+
+                               if (seq->effectdata == NULL) {
+                                       struct SeqEffectHandle effect_handle = BKE_sequence_get_effect(seq);
+                                       effect_handle.init(seq);
+                               }
+
+                               TextVars *data = seq->effectdata;
+                               if (data->color[3] == 0.0f) {
+                                       copy_v4_fl(data->color, 1.0f);
+                                       data->shadow_color[3] = 1.0f;
                                }
                        }
                        SEQ_END
index b40519386cc9e1745784ba89132aca446671ea52..0f2eb9412e7eedced5e9c28b3c70f62fb625ad69 100644 (file)
@@ -494,6 +494,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;
@@ -533,6 +536,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;