diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-25 08:11:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-25 08:19:58 +0300 |
commit | bdbf4471a6c4ba2d444eea5e7f0e6984b3aaafc2 (patch) | |
tree | 0aeabc52f0b6c770270b0dfe5f5877cb790c826d /source/blender/editors | |
parent | c7c6070a6469055a1a503acec47780a2de30c218 (diff) |
TexFace removal part 3
- MTexPoly structure & layer type.
- The 'Mesh.uv_textures' layers.
- DerivedMesh TexFace drawing.
- Scripts & UI.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 10 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 52 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_data_transfer.c | 10 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 6 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_uv.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw_legacy.c | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 9 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 4 |
14 files changed, 43 insertions, 74 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index e3e9b7ade81..d069241defd 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -113,8 +113,8 @@ struct UvElementMap *BM_uv_element_map_create( void BM_uv_element_map_free(struct UvElementMap *vmap); struct UvElement *BM_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l); -bool EDBM_mtexpoly_check(struct BMEditMesh *em); -struct BMFace *EDBM_mtexpoly_active_get(struct BMEditMesh *em, const bool sloppy, const bool selected); +bool EDBM_uv_check(struct BMEditMesh *em); +struct BMFace *EDBM_uv_active_face_get(struct BMEditMesh *em, const bool sloppy, const bool selected); void BM_uv_vert_map_free(struct UvVertMap *vmap); struct UvMapVert *BM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 288d65168d8..7300d6f4e52 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -601,7 +601,6 @@ UvVertMap *BM_uv_vert_map_create( newvlist = v; efa = BM_face_at_index(bm, v->f); - /* tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */ l = BM_iter_at_index(bm, BM_LOOPS_OF_FACE, efa, v->tfindex); luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); @@ -613,7 +612,6 @@ UvVertMap *BM_uv_vert_map_create( while (iterv) { next = iterv->next; efa = BM_face_at_index(bm, iterv->f); - /* tf = CustomData_bmesh_get(&bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */ l = BM_iter_at_index(bm, BM_LOOPS_OF_FACE, efa, iterv->tfindex); luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); @@ -928,11 +926,11 @@ UvElement *BM_uv_element_get(UvElementMap *map, BMFace *efa, BMLoop *l) /* last_sel, use em->act_face otherwise get the last selected face in the editselections * at the moment, last_sel is mainly useful for making sure the space image dosnt flicker */ -BMFace *EDBM_mtexpoly_active_get(BMEditMesh *em, const bool sloppy, const bool selected) +BMFace *EDBM_uv_active_face_get(BMEditMesh *em, const bool sloppy, const bool selected) { BMFace *efa = NULL; - if (!EDBM_mtexpoly_check(em)) + if (!EDBM_uv_check(em)) return NULL; efa = BM_mesh_active_face_get(em->bm, sloppy, selected); @@ -945,10 +943,10 @@ BMFace *EDBM_mtexpoly_active_get(BMEditMesh *em, const bool sloppy, const bool s } /* can we edit UV's for this mesh?*/ -bool EDBM_mtexpoly_check(BMEditMesh *em) +bool EDBM_uv_check(BMEditMesh *em) { /* some of these checks could be a touch overkill */ - return em && em->bm->totface && CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY) && + return em && em->bm->totface && CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV); } diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 036d084a91c..333c8b29667 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -251,8 +251,8 @@ void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum) void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me) { /* could be ldata or pdata */ - CustomData *pdata = GET_CD_DATA(me, pdata); - const int layernum = CustomData_get_active_layer_index(pdata, CD_MTEXPOLY); + CustomData *ldata = GET_CD_DATA(me, ldata); + const int layernum = CustomData_get_active_layer_index(ldata, CD_MLOOPUV); ED_mesh_uv_loop_reset_ex(me, layernum); WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); @@ -269,21 +269,10 @@ int ED_mesh_uv_texture_add(Mesh *me, const char *name, const bool active_set) if (me->edit_btmesh) { em = me->edit_btmesh; - layernum_dst = CustomData_number_of_layers(&em->bm->pdata, CD_MTEXPOLY); + layernum_dst = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPUV); if (layernum_dst >= MAX_MTFACE) return -1; - /* CD_MTEXPOLY */ - BM_data_layer_add_named(em->bm, &em->bm->pdata, CD_MTEXPOLY, name); - /* copy data from active UV */ - if (layernum_dst) { - const int layernum_src = CustomData_get_active_layer(&em->bm->pdata, CD_MTEXPOLY); - BM_data_layer_copy(em->bm, &em->bm->pdata, CD_MTEXPOLY, layernum_src, layernum_dst); - } - if (active_set || layernum_dst == 0) { - CustomData_set_layer_active(&em->bm->pdata, CD_MTEXPOLY, layernum_dst); - } - /* CD_MLOOPUV */ BM_data_layer_add_named(em->bm, &em->bm->ldata, CD_MLOOPUV, name); /* copy data from active UV */ @@ -298,26 +287,22 @@ int ED_mesh_uv_texture_add(Mesh *me, const char *name, const bool active_set) } } else { - layernum_dst = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY); + layernum_dst = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV); if (layernum_dst >= MAX_MTFACE) return -1; - if (me->mtpoly) { - CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DUPLICATE, me->mtpoly, me->totpoly, name); + if (me->mloopuv) { CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DUPLICATE, me->mloopuv, me->totloop, name); CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface, name); is_init = true; } else { - CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DEFAULT, NULL, me->totpoly, name); CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, me->totloop, name); CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface, name); } if (active_set || layernum_dst == 0) { - CustomData_set_layer_active(&me->pdata, CD_MTEXPOLY, layernum_dst); CustomData_set_layer_active(&me->ldata, CD_MLOOPUV, layernum_dst); - CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum_dst); } @@ -343,12 +328,12 @@ void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name) if (me->edit_btmesh) { em = me->edit_btmesh; - layernum_dst = CustomData_number_of_layers(&em->bm->pdata, CD_MTEXPOLY); + layernum_dst = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPUV); if (layernum_dst == 0) ED_mesh_uv_texture_add(me, name, true); } else { - layernum_dst = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY); + layernum_dst = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV); if (layernum_dst == 0) ED_mesh_uv_texture_add(me, name, true); } @@ -357,20 +342,16 @@ void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name) bool ED_mesh_uv_texture_remove_index(Mesh *me, const int n) { - CustomData *pdata = GET_CD_DATA(me, pdata), *ldata = GET_CD_DATA(me, ldata); - CustomDataLayer *cdlp, *cdlu; + CustomData *ldata = GET_CD_DATA(me, ldata); + CustomDataLayer *cdlu; int index; - index = CustomData_get_layer_index_n(pdata, CD_MTEXPOLY, n); - cdlp = (index == -1) ? NULL : &pdata->layers[index]; - index = CustomData_get_layer_index_n(ldata, CD_MLOOPUV, n); cdlu = (index == -1) ? NULL : &ldata->layers[index]; - if (!cdlp || !cdlu) + if (!cdlu) return false; - delete_customdata_layer(me, cdlp); delete_customdata_layer(me, cdlu); DAG_id_tag_update(&me->id, 0); @@ -381,14 +362,8 @@ bool ED_mesh_uv_texture_remove_index(Mesh *me, const int n) bool ED_mesh_uv_texture_remove_active(Mesh *me) { /* texpoly/uv are assumed to be in sync */ - CustomData *pdata = GET_CD_DATA(me, pdata); - const int n = CustomData_get_active_layer(pdata, CD_MTEXPOLY); - - /* double check active layers align! */ -#ifdef DEBUG CustomData *ldata = GET_CD_DATA(me, ldata); - BLI_assert(CustomData_get_active_layer(ldata, CD_MLOOPUV) == n); -#endif + const int n = CustomData_get_active_layer(ldata, CD_MLOOPUV); if (n != -1) { return ED_mesh_uv_texture_remove_index(me, n); @@ -400,8 +375,8 @@ bool ED_mesh_uv_texture_remove_active(Mesh *me) bool ED_mesh_uv_texture_remove_named(Mesh *me, const char *name) { /* texpoly/uv are assumed to be in sync */ - CustomData *pdata = GET_CD_DATA(me, pdata); - const int n = CustomData_get_named_layer(pdata, CD_MTEXPOLY, name); + CustomData *ldata = GET_CD_DATA(me, ldata); + const int n = CustomData_get_named_layer(ldata, CD_MLOOPUV, name); if (n != -1) { return ED_mesh_uv_texture_remove_index(me, n); } @@ -1292,7 +1267,6 @@ void ED_mesh_calc_tessface(Mesh *mesh, bool free_mpoly) mesh->mloopcol = NULL; mesh->mloopuv = NULL; mesh->mpoly = NULL; - mesh->mtpoly = NULL; } } diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index c6f27bc9c95..92a3850f2f3 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -158,7 +158,7 @@ static bool multiresbake_check(bContext *C, wmOperator *op) break; } - if (!me->mtpoly) { + if (!me->mloopuv) { BKE_report(op->reports, RPT_ERROR, "Mesh should be unwrapped before multires data baking"); ok = false; diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index acee69daab7..250737a130c 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -135,19 +135,19 @@ static EnumPropertyItem *dt_layers_select_src_itemf( if (ob_src) { DerivedMesh *dm_src; - CustomData *pdata; + CustomData *ldata; int num_data, i; /* XXX Is this OK? */ - dm_src = mesh_get_derived_final(scene, ob_src, CD_MASK_BAREMESH | CD_MTEXPOLY); - pdata = dm_src->getPolyDataLayout(dm_src); - num_data = CustomData_number_of_layers(pdata, CD_MTEXPOLY); + dm_src = mesh_get_derived_final(scene, ob_src, CD_MASK_BAREMESH | CD_MLOOPUV); + ldata = dm_src->getLoopDataLayout(dm_src); + num_data = CustomData_number_of_layers(ldata, CD_MLOOPUV); RNA_enum_item_add_separator(&item, &totitem); for (i = 0; i < num_data; i++) { tmp_item.value = i; - tmp_item.identifier = tmp_item.name = CustomData_get_layer_name(pdata, CD_MTEXPOLY, i); + tmp_item.identifier = tmp_item.name = CustomData_get_layer_name(ldata, CD_MLOOPUV, i); RNA_enum_item_add(&item, &totitem, &tmp_item); } } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 7cabd1c3b10..e743607b75b 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3487,7 +3487,7 @@ static void proj_paint_layer_clone_init( /* use clone mtface? */ if (ps->do_layer_clone) { - const int layer_num = CustomData_get_clone_layer(&((Mesh *)ps->ob->data)->pdata, CD_MTEXPOLY); + const int layer_num = CustomData_get_clone_layer(&((Mesh *)ps->ob->data)->ldata, CD_MLOOPUV); ps->dm_mloopuv_clone = MEM_mallocN(ps->dm_totpoly * sizeof(MLoopUV *), "proj_paint_mtfaces"); @@ -3846,7 +3846,7 @@ static void project_paint_begin( if (ps->do_layer_stencil || ps->do_stencil_brush) { //int layer_num = CustomData_get_stencil_layer(&ps->dm->loopData, CD_MLOOPUV); - int layer_num = CustomData_get_stencil_layer(&((Mesh *)ps->ob->data)->pdata, CD_MTEXPOLY); + int layer_num = CustomData_get_stencil_layer(&((Mesh *)ps->ob->data)->ldata, CD_MLOOPUV); if (layer_num != -1) ps->dm_mloopuv_stencil = CustomData_get_layer_n(&ps->dm->loopData, CD_MLOOPUV, layer_num); @@ -5590,7 +5590,7 @@ bool BKE_paint_proj_mesh_data_check(Scene *scene, Object *ob, bool *uvs, bool *m } me = BKE_mesh_from_object(ob); - layernum = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY); + layernum = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV); if (layernum == 0) { hasuvs = false; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index ff1fb30bea6..b9b808e529d 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -173,7 +173,7 @@ static int uv_sculpt_brush_poll_do(bContext *C, const bool check_region) } em = BKE_editmesh_from_object(obedit); - ret = EDBM_mtexpoly_check(em); + ret = EDBM_uv_check(em); if (ret) { ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index f19a6d64faa..a3a115b3e6a 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -365,7 +365,7 @@ bool ED_space_image_show_uvedit(SpaceImage *sima, Object *obedit) struct BMEditMesh *em = BKE_editmesh_from_object(obedit); bool ret; - ret = EDBM_mtexpoly_check(em); + ret = EDBM_uv_check(em); return ret; } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 328aa161ede..baa1dcdffd9 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -427,7 +427,7 @@ static void image_refresh(const bContext *C, ScrArea *sa) } else { /* old shading system, we set texface */ - if (em && EDBM_mtexpoly_check(em)) { + if (em && EDBM_uv_check(em)) { BMFace *efa = BM_mesh_active_face_get(em->bm, sloppy, selected); if (efa) { diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 8ae7e88280f..500abfe6c63 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -748,7 +748,7 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { PointerRNA dataptr = RNA_pointer_get(&obptr, "data"); - uiItemPointerR(col, ptr, "uv_layer", &dataptr, "uv_textures", "", ICON_NONE); + uiItemPointerR(col, ptr, "uv_layer", &dataptr, "uv_layers", "", ICON_NONE); uiItemPointerR(col, ptr, "color_layer", &dataptr, "vertex_colors", "", ICON_NONE); } else { @@ -966,7 +966,7 @@ static void node_shader_buts_uvmap(uiLayout *layout, bContext *C, PointerRNA *pt if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { PointerRNA dataptr = RNA_pointer_get(&obptr, "data"); - uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_textures", "", ICON_NONE); + uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE); } } } @@ -985,7 +985,7 @@ static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRN if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { PointerRNA dataptr = RNA_pointer_get(&obptr, "data"); - uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_textures", "", ICON_NONE); + uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE); } else uiItemR(layout, ptr, "uv_map", 0, "", 0); @@ -1007,7 +1007,7 @@ static void node_shader_buts_tangent(uiLayout *layout, bContext *C, PointerRNA * if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) { PointerRNA dataptr = RNA_pointer_get(&obptr, "data"); - uiItemPointerR(row, ptr, "uv_map", &dataptr, "uv_textures", "", ICON_NONE); + uiItemPointerR(row, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE); } else uiItemR(row, ptr, "uv_map", 0, "", 0); diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index 4936203e4ce..bc74475e8cc 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -1454,7 +1454,7 @@ CustomDataMask ED_view3d_datamask(const Scene *scene, const View3D *v3d) if (ELEM(drawtype, OB_TEXTURE, OB_MATERIAL) || ((drawtype == OB_SOLID) && (v3d->flag2 & V3D_SOLID_TEX))) { - mask |= CD_MASK_MTEXPOLY | CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL; + mask |= CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL; if (BKE_scene_use_new_shading_nodes(scene)) { if (drawtype == OB_MATERIAL) diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 1cb913c316a..2a8b4928b46 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -624,7 +624,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, SceneLayer *sl, Object *obe unsigned int pos; - efa_act = EDBM_mtexpoly_active_get(em, false, false); /* will be set to NULL if hidden */ + efa_act = EDBM_uv_active_face_get(em, false, false); /* will be set to NULL if hidden */ ts = scene->toolsettings; drawfaces = draw_uvs_face_check(scene); @@ -1039,7 +1039,7 @@ static void draw_uv_shadows_get(SpaceImage *sima, Object *ob, Object *obedit, bo 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_shadow = EDBM_uv_check(em); } *show_texpaint = (ob && ob->type == OB_MESH && ob->mode == OB_MODE_TEXTURE_PAINT); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 02257a08c21..9d1c36aff31 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -106,7 +106,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; } @@ -218,11 +218,10 @@ void ED_uvedit_assign_image(Main *UNUSED(bmain), Scene *scene, Object *obedit, I #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; } @@ -3828,7 +3827,7 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) em = me->edit_btmesh; bm = em->bm; - if (!EDBM_mtexpoly_check(em)) { + if (!EDBM_uv_check(em)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index c362a8a6f2d..0cb117da341 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -117,7 +117,7 @@ static bool ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit) if (ED_uvedit_test(obedit)) return 1; - if (em && em->bm->totface && !CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) + if (em && em->bm->totface && !CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV)) ED_mesh_uv_texture_add(obedit->data, NULL, true); if (!ED_uvedit_test(obedit)) @@ -1632,8 +1632,6 @@ void ED_uvedit_unwrap_cube_project(Object *ob, BMesh *bm, float cube_size, bool BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) { int first = 1; - - /* tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); */ /* UNUSED */ if (use_select && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) continue; |