bugfix [#25238] Render image window edits UV's

This commit is contained in:
2010-12-20 05:26:25 +00:00
parent 3bed4cbf2b
commit 8e80ada09a
3 changed files with 7 additions and 19 deletions

View 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)

View 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))
if(sima && (ED_space_image_show_render(sima) || ED_space_image_show_paint(sima)))
return 0;
if(ED_space_image_show_paint(sima))
return 0;
if(obedit && obedit->type == OB_MESH) {
EditMesh *em = BKE_mesh_get_editmesh(obedit->data);
int ret;

View 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) {