[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58046] branches/soc-2013-paint: Add option under view menu of image editor to turn display of texture
Antony Riakiotakis
kalast at gmail.com
Sat Jul 6 20:21:04 CEST 2013
Revision: 58046
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58046
Author: psy-fi
Date: 2013-07-06 18:21:03 +0000 (Sat, 06 Jul 2013)
Log Message:
-----------
Add option under view menu of image editor to turn display of texture
paint object UVs off. For cluttered meshes it may be useful to have.
Modified Paths:
--------------
branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
branches/soc-2013-paint/source/blender/editors/include/ED_image.h
branches/soc-2013-paint/source/blender/editors/space_image/image_edit.c
branches/soc-2013-paint/source/blender/editors/uvedit/uvedit_draw.c
branches/soc-2013-paint/source/blender/makesdna/DNA_space_types.h
branches/soc-2013-paint/source/blender/makesrna/intern/rna_space.c
Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-07-06 18:20:54 UTC (rev 58045)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-07-06 18:21:03 UTC (rev 58046)
@@ -48,6 +48,7 @@
sima = context.space_data
uv = sima.uv_editor
toolsettings = context.tool_settings
+ paint = toolsettings.image_paint
show_uvedit = sima.show_uvedit
show_render = sima.show_render
@@ -62,6 +63,8 @@
layout.prop(toolsettings, "show_uv_local_view")
layout.prop(uv, "show_other_objects")
+ if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'):
+ layout.prop(uv, "show_texpaint")
layout.separator()
Modified: branches/soc-2013-paint/source/blender/editors/include/ED_image.h
===================================================================
--- branches/soc-2013-paint/source/blender/editors/include/ED_image.h 2013-07-06 18:20:54 UTC (rev 58045)
+++ branches/soc-2013-paint/source/blender/editors/include/ED_image.h 2013-07-06 18:21:03 UTC (rev 58046)
@@ -69,6 +69,7 @@
int ED_space_image_show_render(struct SpaceImage *sima);
int ED_space_image_show_paint(struct SpaceImage *sima);
int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
+int ED_space_image_show_texpaint(struct SpaceImage *sima, struct Object *ob);
int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit);
int ED_space_image_check_show_maskedit(struct Scene *scene, struct SpaceImage *sima);
Modified: branches/soc-2013-paint/source/blender/editors/space_image/image_edit.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/space_image/image_edit.c 2013-07-06 18:20:54 UTC (rev 58045)
+++ branches/soc-2013-paint/source/blender/editors/space_image/image_edit.c 2013-07-06 18:21:03 UTC (rev 58046)
@@ -304,6 +304,13 @@
return (sima->mode == SI_MODE_PAINT);
}
+int ED_space_image_show_texpaint(SpaceImage *sima, Object *ob)
+{
+ return (ob && ob->type == OB_MESH &&
+ ob->mode == OB_MODE_TEXTURE_PAINT &&
+ !(sima->flag & SI_NO_DRAW_TEXPAINT));
+}
+
int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
{
if (sima && (ED_space_image_show_render(sima) || ED_space_image_show_paint(sima)))
@@ -333,7 +340,7 @@
ret = EDBM_mtexpoly_check(em);
- return ret;
+ return ret && !(sima->flag & SI_NO_DRAW_TEXPAINT);
}
return 0;
Modified: branches/soc-2013-paint/source/blender/editors/uvedit/uvedit_draw.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/uvedit/uvedit_draw.c 2013-07-06 18:20:54 UTC (rev 58045)
+++ branches/soc-2013-paint/source/blender/editors/uvedit/uvedit_draw.c 2013-07-06 18:21:03 UTC (rev 58046)
@@ -809,7 +809,7 @@
ToolSettings *toolsettings = scene->toolsettings;
int show_uvedit, show_uvshadow, show_texpaint_uvshadow;
- show_texpaint_uvshadow = (obact && obact->type == OB_MESH && obact->mode == OB_MODE_TEXTURE_PAINT);
+ 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);
Modified: branches/soc-2013-paint/source/blender/makesdna/DNA_space_types.h
===================================================================
--- branches/soc-2013-paint/source/blender/makesdna/DNA_space_types.h 2013-07-06 18:20:54 UTC (rev 58045)
+++ branches/soc-2013-paint/source/blender/makesdna/DNA_space_types.h 2013-07-06 18:21:03 UTC (rev 58046)
@@ -790,6 +790,8 @@
SI_DRAW_OTHER = (1 << 23),
SI_COLOR_CORRECTION = (1 << 24),
+
+ SI_NO_DRAW_TEXPAINT = (1 << 25)
} eSpaceImage_Flag;
/* Text Editor ============================================ */
Modified: branches/soc-2013-paint/source/blender/makesrna/intern/rna_space.c
===================================================================
--- branches/soc-2013-paint/source/blender/makesrna/intern/rna_space.c 2013-07-06 18:20:54 UTC (rev 58045)
+++ branches/soc-2013-paint/source/blender/makesrna/intern/rna_space.c 2013-07-06 18:21:03 UTC (rev 58046)
@@ -1401,6 +1401,11 @@
RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
+ prop = RNA_def_property(srna, "show_texpaint", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAW_TEXPAINT);
+ 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, "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",
More information about the Bf-blender-cvs
mailing list