Fix adding a paint texture slot not refreshing
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Feb 2019 03:40:11 +0000 (14:40 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Feb 2019 03:47:02 +0000 (14:47 +1100)
Adding a new slot wasn't refreshing when the
object had no material.

source/blender/blenkernel/intern/material.c

index b4dffc1..17a26f1 100644 (file)
@@ -1089,7 +1089,8 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma)
        if (!ma)
                return;
 
-       DEG_id_tag_update(&ma->id, ID_RECALC_SHADING);
+       /* COW needed when adding texture slot on an object with no materials. */
+       DEG_id_tag_update(&ma->id, ID_RECALC_SHADING | ID_RECALC_COPY_ON_WRITE);
 
        if (ma->texpaintslot) {
                MEM_freeN(ma->texpaintslot);