diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-10-02 16:34:53 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-10-02 16:35:08 +0400 |
commit | 9ac0b4ff056060cab78b2b787bc567d72295f3f9 (patch) | |
tree | eb1fb78c725c80fc11667b3926c68e777b1e8e6d /source/blender/editors/uvedit | |
parent | a2aa3eb2e59d5890a4a76290f5e1799c540cb99c (diff) |
Fix T42033 UVs shown while rendering in texture paint mode.
This should be included in final release build.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 36c96a8d011..83fd7e6505d 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -946,14 +946,30 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glPointSize(1.0); } + +static void draw_uv_shadows_get(SpaceImage *sima, Object *ob, Object *obedit, bool *show_shadow, bool *show_texpaint) +{ + *show_shadow = *show_texpaint = false; + + if (ED_space_image_show_render(sima) || (sima->flag & SI_NO_DRAW_TEXPAINT)) + return; + + if ((sima->mode == SI_MODE_PAINT) && obedit && obedit->type == OB_MESH) { + struct BMEditMesh *em = BKE_editmesh_from_object(obedit); + + *show_shadow = EDBM_mtexpoly_check(em); + } + + *show_texpaint = (ob && ob->type == OB_MESH && ob->mode == OB_MODE_TEXTURE_PAINT); +} + void draw_uvedit_main(SpaceImage *sima, ARegion *ar, Scene *scene, Object *obedit, Object *obact) { ToolSettings *toolsettings = scene->toolsettings; - int show_uvedit, show_uvshadow, show_texpaint_uvshadow; + bool show_uvedit, show_uvshadow, show_texpaint_uvshadow; - show_texpaint_uvshadow = ED_space_image_show_texpaint(sima, obact); show_uvedit = ED_space_image_show_uvedit(sima, obedit); - show_uvshadow = ED_space_image_show_uvshadow(sima, obedit); + draw_uv_shadows_get(sima, obact, obedit, &show_uvshadow, &show_texpaint_uvshadow); if (show_uvedit || show_uvshadow || show_texpaint_uvshadow) { if (show_uvshadow) |