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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-28 16:09:19 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-28 21:17:16 +0300
commitda1323d1c95095feff98e8aa054d73fd323c363d (patch)
tree021ec89b4a50696ba8b6ae02df82f278354812cf /source/blender/editors
parentacd462347196fef9450115f28ac2594cb12b0226 (diff)
Fix T60366: texture paint slots not updating when editing material.
Now always refresh when the material changes. Depsgraph tag moved out of the refresh function since that gets called on depsgraph update, which should not trigger a second depsgraph update.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/render/render_update.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c6
-rw-r--r--source/blender/editors/util/ed_util.c2
4 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index 462fd997fc5..6e6154e638a 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -206,6 +206,8 @@ void ED_render_engine_changed(Main *bmain)
static void material_changed(Main *UNUSED(bmain), Material *ma)
{
+ BKE_texpaint_slot_refresh_cache(ma);
+
/* icons */
BKE_icon_changed(BKE_icon_id_ensure(&ma->id));
}
@@ -266,7 +268,7 @@ static void scene_changed(Main *bmain, Scene *scene)
/* glsl */
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->mode & OB_MODE_TEXTURE_PAINT) {
- BKE_texpaint_slots_refresh_object(scene, ob);
+ BKE_texpaint_slots_refresh_object(ob);
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 44f05c39a25..9d90b6fcd5f 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1095,7 +1095,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
/* This has to stay here to regenerate the texture paint
* cache in case we are loading a file */
- BKE_texpaint_slots_refresh_object(scene, ob);
+ BKE_texpaint_slots_refresh_object(ob);
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index d803b4d0aa8..b4abab0fabd 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -5757,7 +5757,7 @@ bool BKE_paint_proj_mesh_data_check(Scene *scene, Object *ob, bool *uvs, bool *m
hasmat = true;
if (!ma->texpaintslot) {
/* refresh here just in case */
- BKE_texpaint_slot_refresh_cache(scene, ma);
+ BKE_texpaint_slot_refresh_cache(ma);
/* if still no slots, we have to add */
if (ma->texpaintslot) {
@@ -6017,13 +6017,13 @@ static bool proj_paint_add_slot(bContext *C, wmOperator *op)
nodePositionPropagate(out_node);
if (ima) {
- BKE_texpaint_slot_refresh_cache(scene, ma);
+ BKE_texpaint_slot_refresh_cache(ma);
BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_USER_NEW_IMAGE);
WM_event_add_notifier(C, NC_IMAGE | NA_ADDED, ima);
}
DEG_id_tag_update(&ntree->id, 0);
- DEG_id_tag_update(&ma->id, ID_RECALC_SHADING);
+ DEG_id_tag_update(&ma->id, ID_RECALC_SHADING | ID_RECALC_COPY_ON_WRITE);
ED_area_tag_redraw(CTX_wm_area(C));
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 6f0c8594446..ea99dd9996e 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -90,7 +90,7 @@ void ED_editors_init_for_undo(Main *bmain)
if (ob->mode & OB_MODE_TEXTURE_PAINT) {
Scene *scene = WM_window_get_active_scene(win);
- BKE_texpaint_slots_refresh_object(scene, ob);
+ BKE_texpaint_slots_refresh_object(ob);
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
}
}