bugfix [#25238] Render image window edits UV's
authorCampbell Barton <ideasman42@gmail.com>
Mon, 20 Dec 2010 05:26:25 +0000 (05:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 20 Dec 2010 05:26:25 +0000 (05:26 +0000)
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/transform/transform_conversions.c

index 5e2a908776ddff11c1631745008a353b87d7e549..74c75a664b079096b36c955aecd522289d1c8d04 100644 (file)
@@ -54,6 +54,7 @@
 #include "WM_types.h"
 
 #include "ED_util.h"
+#include "ED_image.h"
 #include "ED_screen.h"
 #include "ED_object.h"
 #include "ED_armature.h"
@@ -320,23 +321,12 @@ int ED_operator_posemode(bContext *C)
        return 0;
 }
 
-
+/* wrapper for ED_space_image_show_uvedit */
 int ED_operator_uvedit(bContext *C)
 {
+       SpaceImage *sima= CTX_wm_space_image(C);
        Object *obedit= CTX_data_edit_object(C);
-       EditMesh *em= NULL;
-       
-       if(obedit && obedit->type==OB_MESH)
-               em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
-       
-       if(em && (em->faces.first) && (CustomData_has_layer(&em->fdata, CD_MTFACE))) {
-               BKE_mesh_end_editmesh(obedit->data, em);
-               return 1;
-       }
-       
-       if(obedit)
-               BKE_mesh_end_editmesh(obedit->data, em);
-       return 0;
+       return ED_space_image_show_uvedit(sima, obedit);
 }
 
 int ED_operator_uvmap(bContext *C)
index 58ae3d0df87c39ab99dd2b6e2e52d3467a1b7fed..8b8772c6e286af8eeee036cad7a44483f1a22f9b 100644 (file)
@@ -265,11 +265,9 @@ int ED_space_image_show_paint(SpaceImage *sima)
 
 int ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit)
 {
-       if(ED_space_image_show_render(sima))
-               return 0;
-       if(ED_space_image_show_paint(sima))
+       if(sima && (ED_space_image_show_render(sima) || ED_space_image_show_paint(sima)))
                return 0;
-       
+
        if(obedit && obedit->type == OB_MESH) {
                EditMesh *em = BKE_mesh_get_editmesh(obedit->data);
                int ret;
index 64b7596355cea9891d39b10f52e86abec02372d0..90a275883ae84b6ee2483c8219a0b2e894881958 100644 (file)
@@ -2444,7 +2444,7 @@ static void createTransUVs(bContext *C, TransInfo *t)
        EditMesh *em = ((Mesh *)t->obedit->data)->edit_mesh;
        EditFace *efa;
 
-       if(!ED_uvedit_test(t->obedit)) return;
+       if(!ED_space_image_show_uvedit(sima, t->obedit)) return;
 
        /* count */
        for (efa= em->faces.first; efa; efa= efa->next) {