Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 19 Jun 2018 14:49:54 +0000 (16:49 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 19 Jun 2018 14:49:54 +0000 (16:49 +0200)
Conflicts:
source/blender/editors/sculpt_paint/paint_image_proj.c

intern/cycles/kernel/kernel_volume.h
source/blender/editors/sculpt_paint/paint_image_proj.c

index 86378289b02a70fcc9dcc4b212908acdb1d3e477..58032545338a521ad23a3b67321d7227eafe5dab 100644 (file)
@@ -1172,7 +1172,7 @@ ccl_device void kernel_volume_stack_init(KernelGlobals *kg,
                                                break;
                                        }
                                }
-                               if(need_add) {
+                               if(need_add && stack_index < VOLUME_STACK_SIZE - 1) {
                                        stack[stack_index].object = stack_sd->object;
                                        stack[stack_index].shader = stack_sd->shader;
                                        ++stack_index;
index c9233416428223d09573e275a2702581a1020f82..62bc379241fb873ed998618171ed875ebc6b0975 100644 (file)
@@ -3411,13 +3411,13 @@ static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *p
        else {
                ps->dm = mesh_get_derived_final(
                        depsgraph, ps->scene, ps->ob,
-                       ps->scene->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE | (ps->do_face_sel ? CD_ORIGINDEX : 0));
+                       ps->scene->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE | (ps->do_face_sel ? CD_MASK_ORIGINDEX : 0));
                ps->dm_release = false;
        }
 #endif
        ps->me_eval = mesh_get_eval_final(
                          depsgraph, sce, ob,
-                         sce->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE | (ps->do_face_sel ? CD_ORIGINDEX : 0));
+                         sce->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE | (ps->do_face_sel ? CD_MASK_ORIGINDEX : 0));
        if (!CustomData_has_layer(&ps->me_eval->ldata, CD_MLOOPUV)) {
                ps->me_eval = NULL;
                return false;