From 8d5d6de7615c79a79a0ab3fa95319650ebe89206 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 14 Nov 2014 14:06:29 +0100 Subject: Reuse local view for UVs for previous commit, thanks to Campbell for the suggestion. Also minor compile fix after viewport patch --- intern/ghost/intern/GHOST_WindowX11.h | 1 + release/scripts/startup/bl_ui/space_image.py | 2 +- source/blender/editors/space_image/space_image.c | 3 ++- source/blender/editors/uvedit/uvedit_draw.c | 2 +- source/blender/makesdna/DNA_space_types.h | 2 -- source/blender/makesrna/intern/rna_space.c | 5 ----- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h index cd98b394a8d..7bb9a858882 100644 --- a/intern/ghost/intern/GHOST_WindowX11.h +++ b/intern/ghost/intern/GHOST_WindowX11.h @@ -35,6 +35,7 @@ #include "GHOST_Window.h" #include +#include // For tablets #ifdef WITH_X11_XINPUT # include diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 1e3a7433e25..56c0bda5608 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -82,7 +82,7 @@ class IMAGE_MT_view(Menu): layout.prop(uv, "show_other_objects") if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'): layout.prop(uv, "show_texpaint") - layout.prop(uv, "texpaint_filter_mat") + layout.prop(toolsettings, "show_uv_local_view", text="Show same material") layout.separator() diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 770582f4afa..5dc9af2de84 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -33,6 +33,7 @@ #include "DNA_meshdata_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_image_types.h" #include "MEM_guardedalloc.h" @@ -807,7 +808,7 @@ static void image_main_area_listener(bScreen *UNUSED(sc), ScrArea *sa, ARegion * if (wmn->data == ND_SHADING_LINKS) { SpaceImage *sima = sa->spacedata.first; - if (sima->flag & SI_TEXPAINT_FILTER_MATERIAL) + if (sima->iuser.scene && (sima->iuser.scene->toolsettings->uv_flag & UV_SHOW_SAME_IMAGE)) ED_region_tag_redraw(ar); } break; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 7b674e75525..4c93cfa2cc5 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -506,7 +506,7 @@ static void draw_uvs_texpaint(SpaceImage *sima, Scene *scene, Object *ob) mloopuv_base = mloopuv; for (a = me->totpoly; a > 0; a--, mpoly++) { - if ((sima->flag & SI_TEXPAINT_FILTER_MATERIAL) && mpoly->mat_nr != ob->actcol - 1) + if ((scene->toolsettings->uv_flag & UV_SHOW_SAME_IMAGE) && mpoly->mat_nr != ob->actcol - 1) continue; glBegin(GL_LINE_LOOP); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 41b302ebdd8..a8fe8ceb6b0 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -810,8 +810,6 @@ typedef enum eSpaceImage_Flag { SI_COLOR_CORRECTION = (1 << 24), SI_NO_DRAW_TEXPAINT = (1 << 25), - /* filter texpaint uvs based on active material */ - SI_TEXPAINT_FILTER_MATERIAL = (1 << 26) } eSpaceImage_Flag; /* Text Editor ============================================ */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8788a724f0c..68173ebefb4 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1523,11 +1523,6 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Texture Paint UVs", "Draw overlay of texture paint uv layer"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); - prop = RNA_def_property(srna, "texpaint_filter_mat", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_TEXPAINT_FILTER_MATERIAL); - RNA_def_property_ui_text(prop, "Same Material UVs", "Only draw UVs of faces with active material"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); - prop = RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", -- cgit v1.2.3