Reuse local view for UVs for previous commit, thanks to Campbell for the
suggestion. Also minor compile fix after viewport patch
This commit is contained in:
@@ -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>
|
||||
|
@@ -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()
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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 ============================================ */
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user