Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jul 2017 07:21:11 +0000 (17:21 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jul 2017 07:21:11 +0000 (17:21 +1000)
1  2 
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/uvedit/uvedit_ops.c

index 61891907050433ff458b1b0a4801e4575ef49934,68bd8ff27b1d1da8d4b9e5a2a8f8d23882dac75d..c8d8ac683349b44c4651fb5997d8d4d4c6b58c97
@@@ -446,6 -446,9 +446,9 @@@ BMVert *EDBM_vert_find_nearest_ex
                unsigned int index;
                BMVert *eve;
                
+               /* No afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad. */
+               ED_view3d_backbuf_validate(vc);
                index = ED_view3d_backbuf_sample_rect(
                        vc, vc->mval, dist_px, bm_wireoffs, 0xFFFFFF, &dist_test);
                eve = index ? BM_vert_at_index_find_or_table(bm, index - 1) : NULL;
@@@ -630,7 -633,8 +633,8 @@@ BMEdge *EDBM_edge_find_nearest_ex
                float dist_test = 0.0f;
                unsigned int index;
                BMEdge *eed;
-               
+               /* No afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad. */
                ED_view3d_backbuf_validate(vc);
  
                index = ED_view3d_backbuf_sample_rect(vc, vc->mval, dist_px, bm_solidoffs, bm_wireoffs, &dist_test);
@@@ -985,13 -989,13 +989,13 @@@ static EnumPropertyItem prop_similar_ty
  #endif
  
        {SIMFACE_MATERIAL, "MATERIAL", 0, "Material", ""},
 -      {SIMFACE_IMAGE, "IMAGE", 0, "Image", ""},
        {SIMFACE_AREA, "AREA", 0, "Area", ""},
        {SIMFACE_SIDES, "SIDES", 0, "Polygon Sides", ""},
        {SIMFACE_PERIMETER, "PERIMETER", 0, "Perimeter", ""},
        {SIMFACE_NORMAL, "NORMAL", 0, "Normal", ""},
        {SIMFACE_COPLANAR, "COPLANAR", 0, "Co-planar", ""},
        {SIMFACE_SMOOTH, "SMOOTH", 0, "Flat/Smooth", ""},
 +      {SIMFACE_FACEMAP, "FACE_MAP", 0, "Face-Map", ""},
  #ifdef WITH_FREESTYLE
        {SIMFACE_FREESTYLE, "FREESTYLE_FACE", 0, "Freestyle Face Marks", ""},
  #endif
@@@ -1169,7 -1173,7 +1173,7 @@@ static EnumPropertyItem *select_similar
  #ifdef WITH_FREESTYLE
                        const int a_end = SIMFACE_FREESTYLE;
  #else
 -                      const int a_end = SIMFACE_SMOOTH;
 +                      const int a_end = SIMFACE_FACEMAP;
  #endif
                        for (a = SIMFACE_MATERIAL; a <= a_end; a++) {
                                RNA_enum_items_add_value(&item, &totitem, prop_similar_types, a);
index 0e33525ceff02c7e583faae3e729fd365f2ecaa8,d7361f5a2596c40df7d6d524cf213db6d8fdff36..5ee05273a5d281db0a43bdbc57c4726d184c2954
@@@ -57,6 -57,7 +57,6 @@@
  
  #include "BKE_context.h"
  #include "BKE_customdata.h"
 -#include "BKE_depsgraph.h"
  #include "BKE_image.h"
  #include "BKE_library.h"
  #include "BKE_main.h"
@@@ -67,8 -68,6 +67,8 @@@
  #include "BKE_scene.h"
  #include "BKE_editmesh.h"
  
 +#include "DEG_depsgraph.h"
 +
  #include "ED_image.h"
  #include "ED_mesh.h"
  #include "ED_node.h"
@@@ -107,7 -106,7 +107,7 @@@ bool ED_uvedit_test(Object *obedit
                return 0;
  
        em = BKE_editmesh_from_object(obedit);
 -      ret = EDBM_mtexpoly_check(em);
 +      ret = EDBM_uv_check(em);
        
        return ret;
  }
@@@ -183,6 -182,7 +183,6 @@@ void ED_uvedit_assign_image(Main *UNUSE
  {
        BMEditMesh *em;
        BMIter iter;
 -      MTexPoly *tf;
        bool update = false;
        const bool selected = !(scene->toolsettings->uv_flag & UV_SYNC_SELECTION);
        
                BMFace *efa;
  
                int cd_loop_uv_offset;
 -              int cd_poly_tex_offset;
 -
                /* old shading system, assign image to selected faces */
  #ifdef USE_SWITCH_ASPECT
                float prev_aspect[2], fprev_aspect;
  #endif
  
                /* ensure we have a uv map */
 -              if (!CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) {
 -                      BM_data_layer_add(em->bm, &em->bm->pdata, CD_MTEXPOLY);
 +              if (!CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV)) {
                        BM_data_layer_add(em->bm, &em->bm->ldata, CD_MLOOPUV);
                        /* make UVs all nice 0-1 */
 -                      ED_mesh_uv_loop_reset_ex(obedit->data, CustomData_get_active_layer_index(&em->bm->pdata, CD_MTEXPOLY));
 +                      ED_mesh_uv_loop_reset_ex(obedit->data, CustomData_get_active_layer_index(&em->bm->ldata, CD_MLOOPUV));
                        update = true;
                }
  
                cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -              cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
                /* now assign to all visible faces */
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (uvedit_face_visible_test(scene, previma, efa, tf) &&
 +                      if (uvedit_face_visible_test(scene, previma, efa) &&
                            (selected == true || uvedit_face_select_test(scene, efa, cd_loop_uv_offset)))
                        {
 -                              if (ima) {
 -                                      tf->tpage = ima;
 -                                      
 -                                      if (ima->id.us == 0) id_us_plus(&ima->id);
 -                                      else id_lib_extern(&ima->id);
 -
  #ifdef USE_SWITCH_ASPECT
 +                              if (ima) {
                                        /* we also need to correct the aspect of uvs */
                                        if (scene->toolsettings->uvcalc_flag & UVCALC_NO_ASPECT_CORRECT) {
                                                /* do nothing */
                                                        luv->uv[0] /= faspect;
                                                }
                                        }
 -#endif
 -                              }
 -                              else {
 -                                      tf->tpage = NULL;
                                }
 +#endif
 +                              BKE_object_material_edit_image_set(obedit, efa->mat_nr, ima);
  
                                update = true;
                        }
  
                /* and update depdency graph */
                if (update) {
 -                      DAG_id_tag_update(obedit->data, 0);
 +                      DEG_id_tag_update(obedit->data, 0);
                }
        }
  
  }
  
 -/* dotile - 1, set the tile flag (from the space image)
 - *          2, set the tile index for the faces. */
 -static bool uvedit_set_tile(Object *obedit, Image *ima, int curtile)
 -{
 -      BMEditMesh *em;
 -      BMFace *efa;
 -      BMIter iter;
 -      MTexPoly *tf;
 -      int cd_poly_tex_offset;
 -      
 -      /* verify if we have something to do */
 -      if (!ima || !ED_uvedit_test(obedit))
 -              return false;
 -
 -      if ((ima->tpageflag & IMA_TILES) == 0)
 -              return false;
 -
 -      /* skip assigning these procedural images... */
 -      if (ima->type == IMA_TYPE_R_RESULT || ima->type == IMA_TYPE_COMPOSITE)
 -              return false;
 -      
 -      em = BKE_editmesh_from_object(obedit);
 -
 -      cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
 -
 -      BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -              if (BM_elem_flag_test(efa, BM_ELEM_SELECT))
 -                      tf->tile = curtile;  /* set tile index */
 -      }
 -
 -      DAG_id_tag_update(obedit->data, 0);
 -
 -      return true;
 -}
 -
  /*********************** space conversion *********************/
  
  static void uvedit_pixel_to_float(SpaceImage *sima, float *dist, float pixeldist)
@@@ -296,17 -346,14 +296,17 @@@ bool uvedit_face_visible_nolocal(Scene 
                return (BM_elem_flag_test(efa, BM_ELEM_HIDDEN) == 0 && BM_elem_flag_test(efa, BM_ELEM_SELECT));
  }
  
 -bool uvedit_face_visible_test(Scene *scene, Image *ima, BMFace *efa, MTexPoly *tf)
 +bool uvedit_face_visible_test(Scene *scene, Image *ima, BMFace *efa)
  {
        ToolSettings *ts = scene->toolsettings;
  
 -      if (ts->uv_flag & UV_SHOW_SAME_IMAGE)
 -              return (tf->tpage == ima) ? uvedit_face_visible_nolocal(scene, efa) : false;
 -      else
 +      if (ts->uv_flag & UV_SHOW_SAME_IMAGE) {
 +              const Image *face_image = BKE_object_material_edit_image_get(scene->obedit, efa->mat_nr);
 +              return (face_image == ima) ? uvedit_face_visible_nolocal(scene, efa) : false;
 +      }
 +      else {
                return uvedit_face_visible_nolocal(scene, efa);
 +      }
  }
  
  bool uvedit_face_select_test(Scene *scene, BMFace *efa,
@@@ -599,15 -646,18 +599,15 @@@ bool ED_uvedit_minmax(Scene *scene, Ima
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        bool changed = false;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        INIT_MINMAX2(r_min, r_max);
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
                
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -646,14 -696,17 +646,14 @@@ static bool ED_uvedit_median(Scene *sce
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        unsigned int sel = 0;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        zero_v2(co);
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
                
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
        return (sel != 0);
  }
  
 -static bool uvedit_center(Scene *scene, Image *ima, Object *obedit, float cent[2], char mode)
 +bool ED_uvedit_center(Scene *scene, Image *ima, Object *obedit, float cent[2], char mode)
  {
        bool changed = false;
        
  
  void uv_find_nearest_edge(Scene *scene, Image *ima, BMEditMesh *em, const float co[2], NearestHit *hit)
  {
 -      MTexPoly *tf;
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
        int i;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        mindist_squared = 1e10f;
        memset(hit, 0, sizeof(*hit));
        BM_mesh_elem_index_ensure(em->bm, BM_VERT);
        
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
                
                BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
                        dist_squared = dist_squared_to_line_segment_v2(co, luv->uv, luv_next->uv);
  
                        if (dist_squared < mindist_squared) {
 -                              hit->tf = tf;
                                hit->efa = efa;
                                
                                hit->l = l;
  
  static void uv_find_nearest_face(Scene *scene, Image *ima, BMEditMesh *em, const float co[2], NearestHit *hit)
  {
 -      MTexPoly *tf;
        BMFace *efa;
        BMIter iter;
        float mindist, dist, cent[2];
  
        const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        mindist = 1e10f;
        memset(hit, 0, sizeof(*hit));
        hit->luv = hit->luv_next = NULL;
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                uv_poly_center(efa, cent, cd_loop_uv_offset);
                dist = len_manhattan_v2v2(co, cent);
  
                if (dist < mindist) {
 -                      hit->tf = tf;
                        hit->efa = efa;
                        mindist = dist;
                }
@@@ -780,11 -841,13 +780,11 @@@ void uv_find_nearest_vert(Scene *scene
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        float mindist, dist;
        int i;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        /*this will fill in hit.vert1 and hit.vert2*/
        uv_find_nearest_edge(scene, ima, em, co, hit);
        BM_mesh_elem_index_ensure(em->bm, BM_VERT);
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, i) {
                                hit->l = l;
                                hit->luv = luv;
                                hit->luv_next = BM_ELEM_CD_GET_VOID_P(l->next, cd_loop_uv_offset);
 -                              hit->tf = tf;
                                hit->efa = efa;
                                hit->lindex = i;
                        }
@@@ -832,17 -897,20 +832,17 @@@ bool ED_uvedit_nearest_uv(Scene *scene
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        float mindist, dist;
        bool found = false;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        mindist = 1e10f;
        copy_v2_v2(r_uv, co);
        
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
                
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -952,6 -1020,7 +952,6 @@@ static int uv_select_edgeloop(Scene *sc
        BMFace *efa;
        BMIter iter, liter;
        BMLoop *l;
 -      MTexPoly *tf;
        UvVertMap *vmap;
        UvMapVert *iterv_curr;
        UvMapVert *iterv_next;
        bool looking, select;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        /* setup */
        BM_mesh_elem_table_ensure(em->bm, BM_FACE);
                /* find correct valence edges which are not tagged yet, but connect to tagged one */
  
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (!BM_elem_flag_test(efa, BM_ELEM_TAG) && uvedit_face_visible_test(scene, ima, efa, tf)) {
 +                      if (!BM_elem_flag_test(efa, BM_ELEM_TAG) && uvedit_face_visible_test(scene, ima, efa)) {
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                        /* check face not hidden and not tagged */
                                        if (!(iterv_curr = uv_select_edgeloop_vertex_map_get(vmap, efa, l)))
@@@ -1051,6 -1123,7 +1051,6 @@@ static void uv_select_linked(Scene *sce
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        UvVertMap *vmap;
        UvMapVert *vlist, *iterv, *startv;
        char *flag;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BM_mesh_elem_table_ensure(em->bm, BM_FACE); /* we can use this too */
  
-       /* use winding so we don't consider overlapping islands as connected, see T44320 */
-       vmap = BM_uv_vert_map_create(em->bm, limit, !select_faces, true);
+       /* Note, we had 'use winding' so we don't consider overlapping islands as connected, see T44320
+        * this made *every* projection split the island into front/back islands.
+        * Keep 'use_winding' to false, see: T50970.
+        *
+        * Better solve this by having a delimit option for select-linked operator,
+        * keeping island-select working as is. */
+       vmap = BM_uv_vert_map_create(em->bm, limit, !select_faces, false);
  
        if (vmap == NULL)
                return;
  
        if (!hit) {
                BM_ITER_MESH_INDEX (efa, &iter, em->bm, BM_FACES_OF_MESH, a) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 +                      if (uvedit_face_visible_test(scene, ima, efa)) {
                                if (select_faces) {
                                        if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                                                stack[stacksize] = a;
@@@ -1237,9 -1318,12 +1242,9 @@@ static float *uv_sel_co_from_eve(Scene 
        BMLoop *l;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BM_ITER_ELEM (l, &liter, eve, BM_LOOPS_OF_VERT) {
 -              MTexPoly *tf = BM_ELEM_CD_GET_VOID_P(l->f, cd_poly_tex_offset);
 -
 -              if (!uvedit_face_visible_test(scene, ima, l->f, tf))
 +              if (!uvedit_face_visible_test(scene, ima, l->f))
                        continue;
  
                if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) {
@@@ -1265,6 -1349,7 +1270,6 @@@ static int uv_select_more_less(bContex
        ToolSettings *ts = scene->toolsettings;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                if (select) {
  
                /* mark loops to be selected */
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      MTexPoly *tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 +                      if (uvedit_face_visible_test(scene, ima, efa)) {
  
  #define IS_SEL   1
  #define IS_UNSEL 2
  
                /* mark loops to be selected */
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      MTexPoly *tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 +                      if (uvedit_face_visible_test(scene, ima, efa)) {
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
  
                                        MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
@@@ -1397,9 -1486,11 +1402,9 @@@ static void uv_weld_align(bContext *C, 
        SpaceImage *sima;
        Scene *scene;
        Image *ima;
 -      MTexPoly *tf;
        float cent[2], min[2], max[2];
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        scene = CTX_data_scene(C);
        ima = CTX_data_edit_image(C);
                BMLoop *l;
  
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
  
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                tool = (max[0] - min[0] >= max[1] - min[1]) ? 'y' : 'x';
        }
  
 -      uvedit_center(scene, ima, obedit, cent, 0);
 +      ED_uvedit_center(scene, ima, obedit, cent, 0);
  
        if (tool == 'x' || tool == 'w') {
                BMIter iter, liter;
                BMLoop *l;
  
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
  
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                BMLoop *l;
  
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
  
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                /* tag verts with a selected UV */
                BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                        BM_ITER_ELEM (l, &liter, eve, BM_LOOPS_OF_VERT) {
 -                              tf = BM_ELEM_CD_GET_VOID_P(l->f, cd_poly_tex_offset);
 -
 -                              if (!uvedit_face_visible_test(scene, ima, l->f, tf))
 +                              if (!uvedit_face_visible_test(scene, ima, l->f))
                                        continue;
  
                                if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) {
                                /* go over all verts except for endpoints */
                                for (i = 0; i < BLI_array_count(eve_line); i++) {
                                        BM_ITER_ELEM (l, &liter, eve_line[i], BM_LOOPS_OF_VERT) {
 -                                              tf = BM_ELEM_CD_GET_VOID_P(l->f, cd_poly_tex_offset);
 -
 -                                              if (!uvedit_face_visible_test(scene, ima, l->f, tf))
 +                                              if (!uvedit_face_visible_test(scene, ima, l->f))
                                                        continue;
  
                                                if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) {
  
  
        uvedit_live_unwrap_update(sima, scene, obedit);
 -      DAG_id_tag_update(obedit->data, 0);
 +      DEG_id_tag_update(obedit->data, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
  }
  
@@@ -1656,6 -1755,7 +1661,6 @@@ static int uv_remove_doubles_exec(bCont
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
        Image *ima;
 -      MTexPoly *tf;
        int uv_a_index;
        int uv_b_index;
        float *uv_a;
        BMLoop *l;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        sima = CTX_wm_space_image(C);
        scene = CTX_data_scene(C);
  
                /* TODO, use qsort as with MESH_OT_remove_doubles, this isn't optimal */
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
  
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                BLI_array_declare(loop_arr_unselected);
  
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
  
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
        }
  
        uvedit_live_unwrap_update(sima, scene, obedit);
 -      DAG_id_tag_update(obedit->data, 0);
 +      DEG_id_tag_update(obedit->data, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
  
        return OPERATOR_FINISHED;
@@@ -1831,9 -1934,11 +1836,9 @@@ static void uv_select_all_perform(Scen
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        if (ts->uv_flag & UV_SYNC_SELECTION) {
  
                if (action == SEL_TOGGLE) {
                        action = SEL_SELECT;
                        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -      
 -                              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                              if (!uvedit_face_visible_test(scene, ima, efa))
                                        continue;
  
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
        
                
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
  
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -1962,6 -2071,7 +1967,6 @@@ static int uv_mouse_select(bContext *C
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        NearestHit hit;
        int i, selectmode, sticky, sync, *hitv = NULL;
        float penalty[2];
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        /* notice 'limit' is the same no matter the zoom level, since this is like
         * remove doubles and could annoying if it joined points when zoomed out.
                        BM_mesh_elem_index_ensure(em->bm, BM_VERT);
  
                        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                              if (!uvedit_face_visible_test(scene, ima, efa))
                                        continue;
  
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                /* select sticky uvs */
                if (sticky != SI_STICKY_DISABLE) {
                        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                              if (!uvedit_face_visible_test(scene, ima, efa))
                                        continue;
                                
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
  #endif
        }
  
 -      DAG_id_tag_update(obedit->data, 0);
 +      DEG_id_tag_update(obedit->data, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
  
        return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED;
@@@ -2339,7 -2452,7 +2344,7 @@@ static int uv_select_linked_internal(bC
  
        uv_select_linked(scene, ima, em, limit, hit_p, extend, select_faces);
  
 -      DAG_id_tag_update(obedit->data, 0);
 +      DEG_id_tag_update(obedit->data, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
  
        return OPERATOR_FINISHED;
@@@ -2413,10 -2526,12 +2418,10 @@@ static int uv_select_split_exec(bContex
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        bool changed = false;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY);
  
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                BKE_report(op->reports, RPT_ERROR, "Cannot split selection when sync selection is enabled");
        BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
                bool is_sel = false;
                bool is_unsel = false;
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
  
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                /* are we all selected? */
@@@ -2570,6 -2686,7 +2575,6 @@@ static void uv_select_flush_from_tag_fa
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      /* MTexPoly *tf; */
        const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
        
        if ((ts->uv_flag & UV_SYNC_SELECTION) == 0 && sima->sticky == SI_STICKY_VERTEX) {
@@@ -2658,6 -2775,7 +2663,6 @@@ static void uv_select_flush_from_tag_lo
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      /* MTexPoly *tf; */
  
        const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
  
@@@ -2741,6 -2859,7 +2746,6 @@@ static int uv_border_select_exec(bConte
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tf;
        MLoopUV *luv;
        rctf rectf;
        bool changed, pinned, select, extend;
                                    (ts->uv_selectmode == UV_SELECT_FACE);
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        /* get rectangle from operator */
        WM_operator_properties_border_to_rctf(op, &rectf);
                        /* assume not touched */
                        BM_elem_flag_disable(efa, BM_ELEM_TAG);
  
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 +                      if (uvedit_face_visible_test(scene, ima, efa)) {
                                uv_poly_center(efa, cent, cd_loop_uv_offset);
                                if (BLI_rctf_isect_pt_v(&rectf, cent)) {
                                        BM_elem_flag_enable(efa, BM_ELEM_TAG);
                changed = true;
                
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (!uvedit_face_visible_test(scene, ima, efa, tf))
 +                      if (!uvedit_face_visible_test(scene, ima, efa))
                                continue;
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
@@@ -2993,11 -3115,13 +2998,11 @@@ static bool do_lasso_select_mesh_uv(bCo
                (ts->uv_selectmode == UV_SELECT_FACE));
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BMIter iter, liter;
  
        BMFace *efa;
        BMLoop *l;
 -      MTexPoly *tf;
        int screen_uv[2];
        bool changed = false;
        rcti rect;
        }
        else { /* Vert Sel */
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -                      tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -                      if (uvedit_face_visible_test(scene, ima, efa, tf)) {
 +                      if (uvedit_face_visible_test(scene, ima, efa)) {
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                        if ((select) != (uvedit_uv_select_test(scene, l, cd_loop_uv_offset))) {
                                                MLoopUV *luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
@@@ -3124,7 -3249,7 +3129,7 @@@ static void uv_snap_cursor_to_pixels(Sp
  
  static bool uv_snap_cursor_to_selection(Scene *scene, Image *ima, Object *obedit, SpaceImage *sima)
  {
 -      return uvedit_center(scene, ima, obedit, sima->cursor, sima->around);
 +      return ED_uvedit_center(scene, ima, obedit, sima->cursor, sima->around);
  }
  
  static int uv_snap_cursor_exec(bContext *C, wmOperator *op)
@@@ -3182,13 -3307,16 +3187,13 @@@ static bool uv_snap_uvs_to_cursor(Scen
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tface;
        MLoopUV *luv;
        bool changed = false;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tface))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -3209,13 -3337,16 +3214,13 @@@ static bool uv_snap_uvs_offset(Scene *s
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *mtexpoly;
        MLoopUV *luv;
        bool changed = false;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              mtexpoly = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, mtexpoly))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -3237,14 -3368,17 +3242,14 @@@ static bool uv_snap_uvs_to_adjacent_uns
        BMFace *f;
        BMLoop *l, *lsub;
        BMIter iter, liter, lsubiter;
 -      MTexPoly *tface;
        MLoopUV *luv;
        bool changed = false;
        const int cd_loop_uv_offset  = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY);
        
        /* index every vert that has a selected UV using it, but only once so as to
         * get unique indices and to count how much to malloc */
        BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
 -              tface = BM_ELEM_CD_GET_VOID_P(f, cd_poly_tex_offset);
 -              if (uvedit_face_visible_test(scene, ima, f, tface)) {
 +              if (uvedit_face_visible_test(scene, ima, f)) {
                        BM_elem_flag_enable(f, BM_ELEM_TAG);
                        BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
                                BM_elem_flag_set(l, BM_ELEM_TAG, uvedit_uv_select_test(scene, l, cd_loop_uv_offset));
@@@ -3292,19 -3426,22 +3297,19 @@@ static bool uv_snap_uvs_to_pixels(Space
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tface;
        MLoopUV *luv;
        int width = 0, height = 0;
        float w, h;
        bool changed = false;
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        ED_space_image_get_size(sima, &width, &height);
        w = (float)width;
        h = (float)height;
        
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tface))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -3338,7 -3475,7 +3343,7 @@@ static int uv_snap_selection_exec(bCont
                case 2:
                {
                        float center[2];
 -                      if (uvedit_center(scene, ima, obedit, center, sima->around)) {
 +                      if (ED_uvedit_center(scene, ima, obedit, center, sima->around)) {
                                float offset[2];
                                sub_v2_v2v2(offset, sima->cursor, center);
                                changed = uv_snap_uvs_offset(scene, ima, obedit, offset);
                return OPERATOR_CANCELLED;
  
        uvedit_live_unwrap_update(sima, scene, obedit);
 -      DAG_id_tag_update(obedit->data, 0);
 +      DEG_id_tag_update(obedit->data, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
  
        return OPERATOR_FINISHED;
@@@ -3394,13 -3531,16 +3399,13 @@@ static int uv_pin_exec(bContext *C, wmO
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tface;
        MLoopUV *luv;
        const bool clear = RNA_boolean_get(op->ptr, "clear");
        
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tface))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -3449,12 -3589,15 +3454,12 @@@ static int uv_select_pinned_exec(bConte
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
 -      MTexPoly *tface;
        MLoopUV *luv;
        
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 -              tface = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -              if (!uvedit_face_visible_test(scene, ima, efa, tface))
 +              if (!uvedit_face_visible_test(scene, ima, efa))
                        continue;
  
                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
@@@ -3518,11 -3661,13 +3523,11 @@@ static int uv_hide_exec(bContext *C, wm
        BMLoop *l;
        BMIter iter, liter;
        MLoopUV *luv;
 -      MTexPoly *tf;
        const bool swap = RNA_boolean_get(op->ptr, "unselected");
        Image *ima = sima ? sima->image : NULL;
        const int use_face_center = (ts->uv_selectmode == UV_SELECT_FACE);
  
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 -      const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY);
  
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                EDBM_mesh_hide(em, swap);
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                int hide = 0;
  
 -              tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset);
 -
 -              if (!uvedit_face_visible_test(scene, ima, efa, tf)) {
 +              if (!uvedit_face_visible_test(scene, ima, efa)) {
                        continue;
                }
  
@@@ -3811,6 -3958,73 +3816,6 @@@ static void UV_OT_cursor_set(wmOperator
                             "Cursor location in normalized (0.0-1.0) coordinates", -10.0f, 10.0f);
  }
  
 -/********************** set tile operator **********************/
 -
 -static int set_tile_exec(bContext *C, wmOperator *op)
 -{
 -      Image *ima = CTX_data_edit_image(C);
 -      int tile[2];
 -      Object *obedit = CTX_data_edit_object(C);
 -
 -      RNA_int_get_array(op->ptr, "tile", tile);
 -
 -      if (uvedit_set_tile(obedit, ima, tile[0] + ima->xrep * tile[1])) {
 -              WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
 -              WM_event_add_notifier(C, NC_SPACE | ND_SPACE_IMAGE, NULL);
 -
 -              return OPERATOR_FINISHED;
 -      }
 -      
 -      return OPERATOR_CANCELLED;
 -}
 -
 -static int set_tile_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 -{
 -      SpaceImage *sima = CTX_wm_space_image(C);
 -      Image *ima = CTX_data_edit_image(C);
 -      ARegion *ar = CTX_wm_region(C);
 -      float fx, fy;
 -      int tile[2];
 -
 -      if (!ima || !(ima->tpageflag & IMA_TILES))
 -              return OPERATOR_CANCELLED;
 -
 -      UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy);
 -
 -      if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) {
 -              fx = fx * ima->xrep;
 -              fy = fy * ima->yrep;
 -              
 -              tile[0] = fx;
 -              tile[1] = fy;
 -              
 -              sima->curtile = tile[1] * ima->xrep + tile[0];
 -              RNA_int_set_array(op->ptr, "tile", tile);
 -      }
 -
 -      return set_tile_exec(C, op);
 -}
 -
 -static void UV_OT_tile_set(wmOperatorType *ot)
 -{
 -      /* identifiers */
 -      ot->name = "Set Tile";
 -      ot->description = "Set UV image tile coordinates";
 -      ot->idname = "UV_OT_tile_set";
 -      
 -      /* api callbacks */
 -      ot->exec = set_tile_exec;
 -      ot->invoke = set_tile_invoke;
 -      ot->poll = ED_operator_image_active;
 -
 -      /* flags */
 -      ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 -
 -      /* properties */
 -      RNA_def_int_vector(ot->srna, "tile", 2, NULL, 0, INT_MAX, "Tile", "Tile coordinate", 0, 10);
 -}
 -
 -
  static int uv_seams_from_islands_exec(bContext *C, wmOperator *op)
  {
        UvVertMap *vmap;
        em = me->edit_btmesh;
        bm = em->bm;
  
 -      if (!EDBM_mtexpoly_check(em)) {
 +      if (!EDBM_uv_check(em)) {
                return OPERATOR_CANCELLED;
        }
  
  
        BM_uv_vert_map_free(vmap);
  
 -      DAG_id_tag_update(&me->id, 0);
 +      DEG_id_tag_update(&me->id, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
  
        return OPERATOR_FINISHED;
@@@ -3975,7 -4189,7 +3980,7 @@@ static int uv_mark_seam_exec(bContext *
        if (scene->toolsettings->edge_mode_live_unwrap)
                ED_unwrap_lscm(scene, ob, false);
  
 -      DAG_id_tag_update(&me->id, 0);
 +      DEG_id_tag_update(&me->id, 0);
        WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
  
        return OPERATOR_FINISHED;
@@@ -4065,6 -4279,7 +4070,6 @@@ void ED_operatortypes_uvedit(void
        WM_operatortype_append(UV_OT_hide);
  
        WM_operatortype_append(UV_OT_cursor_set);
 -      WM_operatortype_append(UV_OT_tile_set);
  }
  
  void ED_keymap_uvedit(wmKeyConfig *keyconf)
  
        /* cursor */
        WM_keymap_add_item(keymap, "UV_OT_cursor_set", ACTIONMOUSE, KM_PRESS, 0, 0);
 -      WM_keymap_add_item(keymap, "UV_OT_tile_set", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
        
        /* menus */
        WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_snap", SKEY, KM_PRESS, KM_SHIFT, 0);