Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-10-02 16:34:53 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-10-02 16:35:08 +0400
commit9ac0b4ff056060cab78b2b787bc567d72295f3f9 (patch)
treeeb1fb78c725c80fc11667b3926c68e777b1e8e6d
parenta2aa3eb2e59d5890a4a76290f5e1799c540cb99c (diff)
Fix T42033 UVs shown while rendering in texture paint mode.
This should be included in final release build.
-rw-r--r--source/blender/editors/include/ED_image.h2
-rw-r--r--source/blender/editors/space_image/image_edit.c25
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c22
3 files changed, 19 insertions, 30 deletions
diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h
index db13c628ade..a9995de068e 100644
--- a/source/blender/editors/include/ED_image.h
+++ b/source/blender/editors/include/ED_image.h
@@ -69,8 +69,6 @@ void ED_image_point_pos__reverse(struct SpaceImage *sima, struct ARegion *ar, co
bool ED_space_image_show_render(struct SpaceImage *sima);
bool ED_space_image_show_paint(struct SpaceImage *sima);
bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit);
-bool ED_space_image_show_texpaint(struct SpaceImage *sima, struct Object *ob);
-bool ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit);
bool ED_space_image_paint_curve(const struct bContext *C);
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 24b1c54dd9f..757059ebc29 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -303,13 +303,6 @@ bool ED_space_image_show_paint(SpaceImage *sima)
return (sima->mode == SI_MODE_PAINT);
}
-bool 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));
-}
-
bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
{
if (sima && (ED_space_image_show_render(sima) || ED_space_image_show_paint(sima)))
@@ -327,24 +320,6 @@ bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
return false;
}
-bool ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit)
-{
- if (ED_space_image_show_render(sima))
- return false;
-
- if (ED_space_image_show_paint(sima))
- if (obedit && obedit->type == OB_MESH) {
- struct BMEditMesh *em = BKE_editmesh_from_object(obedit);
- bool ret;
-
- ret = EDBM_mtexpoly_check(em);
-
- return ret && !(sima->flag & SI_NO_DRAW_TEXPAINT);
- }
-
- return false;
-}
-
/* matches clip function */
bool ED_space_image_check_show_maskedit(Scene *scene, SpaceImage *sima)
{
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)