Reuse local view for UVs for previous commit, thanks to Campbell for the
authorAntony Riakiotakis <kalast@gmail.com>
Fri, 14 Nov 2014 13:06:29 +0000 (14:06 +0100)
committerAntony Riakiotakis <kalast@gmail.com>
Fri, 14 Nov 2014 13:06:39 +0000 (14:06 +0100)
suggestion.

Also minor compile fix after viewport patch

intern/ghost/intern/GHOST_WindowX11.h
release/scripts/startup/bl_ui/space_image.py
source/blender/editors/space_image/space_image.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c

index cd98b394a8d375160404ad2bbeb635f8e0b6207a..7bb9a858882c0030a17b2fe8f87f6b0ea3f6e744 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "GHOST_Window.h"
 #include <X11/Xlib.h>
+#include <X11/Xutil.h>
 // For tablets
 #ifdef WITH_X11_XINPUT
 #  include <X11/extensions/XInput.h>
index 1e3a7433e250dc901837a9f0f244b8036502544b..56c0bda56082d752873f165364374e20997bf68b 100644 (file)
@@ -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()
 
index 770582f4afa6c1e68455dbdccdc0c971c5e1bc3a..5dc9af2de84613acc74f585fc5918019a80f7c63 100644 (file)
@@ -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;
index 7b674e75525cf68dd6ec39574918e269492b03f3..4c93cfa2cc5209da288bf8c5735201929b8f9359 100644 (file)
@@ -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);
 
index 41b302ebdd84bf6b41f5ea0aa91891dc1850554a..a8fe8ceb6b0be0e89f6ba69efb334789fda27e11 100644 (file)
@@ -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 ============================================ */
index 8788a724f0ccacd8271794a710c276ce6b7d9cde..68173ebefb4727560d7c6169c472809831564c8c 100644 (file)
@@ -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",