resolve glitch in the image space where mask editing and UVs would conflict.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 31 Jul 2012 14:16:27 +0000 (14:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 31 Jul 2012 14:16:27 +0000 (14:16 +0000)
now UV editing overrides mask.

release/scripts/startup/bl_ui/space_image.py
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/editors/include/ED_image.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_image/image_edit.c
source/blender/makesrna/intern/rna_object_api.c

index 3d9b3afc4ee8ba30a099eee465fe2a898cb7dff5..e86c18aeba22b7f56abff130f4f07ed2cce64ab5 100644 (file)
@@ -380,6 +380,8 @@ class IMAGE_HT_header(Header):
         if not show_render:
             layout.prop(sima, "use_image_pin", text="")
 
+        layout.prop(sima, "mode", text="")
+
         # uv editing
         if show_uvedit:
             uvedit = sima.uv_editor
@@ -405,9 +407,7 @@ class IMAGE_HT_header(Header):
             mesh = context.edit_object.data
             layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="")
 
-        layout.prop(sima, "mode", text="")
-
-        if mode == 'MASK':
+        elif mode == 'MASK':
             row = layout.row()
             row.template_ID(sima, "mask", new="mask.new")
 
index b635a37e4f625021f7a707c27a18cb9bb2d4ad50..954fb47806b24ed974ffbc55ed891c1c70556db0 100644 (file)
@@ -161,8 +161,8 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(struct ID *id,
                                           struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata,
                                           int totedge_i, int totface_i, int totloop_i, int totpoly_i,
                                           struct MEdge *medge, struct MFace *mface,
-                                                                                 int *totloop_r, int *totpoly_r,
-                                                                                 struct MLoop **mloop_r, struct MPoly **mpoly_r);
+                                          int *totloop_r, int *totpoly_r,
+                                          struct MLoop **mloop_r, struct MPoly **mpoly_r);
 
 void BKE_mesh_calc_normals_tessface(struct MVert *mverts, int numVerts, struct MFace *mfaces, int numFaces, float (*faceNors_r)[3]);
 
index 641033a2ec951e16f68ad43831cf10d929eb4600..88748d5f0b875e4aff75c8d77e012a8b68583457 100644 (file)
@@ -1754,7 +1754,6 @@ DerivedMesh *CDDM_from_curve_orco(struct Scene *scene, Object *ob)
 
 DerivedMesh *CDDM_from_curve_displist(Object *ob, ListBase *dispbase, int **orco_index_ptr)
 {
-       const short do_orco_as_uv= 1;
        DerivedMesh *dm;
        CDDerivedMesh *cddm;
        MVert *allvert;
@@ -1787,10 +1786,6 @@ DerivedMesh *CDDM_from_curve_displist(Object *ob, ListBase *dispbase, int **orco
 
        CDDM_calc_edges(dm);
 
-       if (do_orco_as_uv ) {
-               BKE_curve_make_orco(NULL, ob);
-       }
-
        return dm;
 }
 
index ae30b646db06057e4b27a9f72493b7eaca54a4d3..d291c500547609cd25e65ac790ea68ce11aa37ca 100644 (file)
@@ -71,7 +71,7 @@ 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_uvshadow(struct SpaceImage *sima, struct Object *obedit);
 
-int ED_space_image_check_show_maskedit(struct SpaceImage *sima);
+int ED_space_image_check_show_maskedit(struct Scene *scene, struct SpaceImage *sima);
 int ED_space_image_maskedit_poll(struct bContext *C);
 int ED_space_image_maskedit_mask_poll(struct bContext *C);
 
index a431ea7ea03d5ad59dec72ac6caa801373c441f1..36353c43cbd69fa8a397cce6b163f4532831ae4a 100644 (file)
@@ -476,7 +476,8 @@ int ED_operator_mask(bContext *C)
                        case SPACE_IMAGE:
                        {
                                SpaceImage *sima = sa->spacedata.first;
-                               return ED_space_image_check_show_maskedit(sima);
+                               Scene *scene = CTX_data_scene(C);
+                               return ED_space_image_check_show_maskedit(scene, sima);
                        }
                }
        }
index 81423560fb5761c6010f63c75e9fc35fd3c29ef3..899685d0dc2e6c8f00b1a71a4cd060a161efdc7f 100644 (file)
@@ -352,8 +352,14 @@ int ED_space_image_show_uvshadow(SpaceImage *sima, Object *obedit)
 }
 
 /* matches clip function */
-int ED_space_image_check_show_maskedit(SpaceImage *sima)
+int ED_space_image_check_show_maskedit(Scene *scene, SpaceImage *sima)
 {
+       /* check editmode - this is reserved for UV editing */
+       Object *ob = OBACT;
+       if (ob && ob->mode & OB_MODE_EDIT) {
+               return FALSE;
+       }
+
        return (sima->mode == SI_MODE_MASK);
 }
 
@@ -362,7 +368,8 @@ int ED_space_image_maskedit_poll(bContext *C)
        SpaceImage *sima = CTX_wm_space_image(C);
 
        if (sima && sima->image) {
-               return ED_space_image_check_show_maskedit(sima);
+               Scene *scene = CTX_data_scene(C);
+               return ED_space_image_check_show_maskedit(scene, sima);
        }
 
        return FALSE;
index 0fefc4c89fb14e910f3652df356312c3a6443944..5cabc328778ff2f00ac19d87978f2a4ce8801497 100644 (file)
@@ -126,7 +126,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
                        }
 
                        /* convert object type to mesh */
-                       BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco ? &orco_index : NULL);
+                       BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco ? (int **)&orco_index : NULL);
 
                        tmpmesh = tmpobj->data;