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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-11-30 17:10:52 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-11-30 17:11:50 +0300
commitdabd6615cc0ecbb82f52415e81c734ad041f7598 (patch)
tree699035303ce0570d36b248269b48c1890f27957c /source/blender/editors
parent06df05a35b1f205151c35089630c3256cf5db7fb (diff)
Fix T58150: crash in Texture Paint after changing selection in Edit Mode.
Texture paint code was retrieving the evaluated mesh from the original object, which isn't supposed to happen, so the cached mesh isn't properly cleaned up by Edit Mode toggle.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index c1bf308797c..5275d899a56 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -3404,17 +3404,24 @@ static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *p
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Object *ob = ps->ob;
+ Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
+ Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
+
+ if (scene_eval == NULL || ob_eval == NULL) {
+ return false;
+ }
+
/* Workaround for subsurf selection, try the display mesh first */
if (ps->source == PROJ_SRC_IMAGE_CAM) {
/* using render mesh, assume only camera was rendered from */
ps->me_eval = mesh_create_eval_final_render(
- depsgraph, ps->scene, ps->ob, ps->scene->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE);
+ depsgraph, scene_eval, ob_eval, scene_eval->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE);
ps->me_eval_free = true;
}
else {
ps->me_eval = mesh_get_eval_final(
- depsgraph, ps->scene, ps->ob,
- ps->scene->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE | (ps->do_face_sel ? CD_MASK_ORIGINDEX : 0));
+ depsgraph, scene_eval, ob_eval,
+ scene_eval->customdata_mask | CD_MASK_MLOOPUV | CD_MASK_MTFACE | (ps->do_face_sel ? CD_MASK_ORIGINDEX : 0));
ps->me_eval_free = false;
}