diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-10-31 16:37:36 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-10-31 16:37:55 +0300 |
commit | a6a3989617e680327bda2357fe506d86574e2618 (patch) | |
tree | c03ce3912491cdd1713043b8448b38ad92f024a6 /source/blender/editors/mesh | |
parent | 46c11c7b7dfc2fd59b1de337cb311617e111012e (diff) |
Texture Paint Add Simple UVs:
Add simple uvs now does a cube unwrap and pack operation. Result is not
optimal by far but it should not result in crashes and it will be quite
usable for simple cases.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 68471bfc2ba..e2ce97a3bdf 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -336,6 +336,26 @@ int ED_mesh_uv_texture_add(Mesh *me, const char *name, const bool active_set) return layernum_dst; } +void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name) +{ + BMEditMesh *em; + int layernum_dst; + + if (me->edit_btmesh) { + em = me->edit_btmesh; + + layernum_dst = CustomData_number_of_layers(&em->bm->pdata, CD_MTEXPOLY); + if (layernum_dst == 0) + ED_mesh_uv_texture_add(me, name, true); + } + else { + layernum_dst = CustomData_number_of_layers(&me->pdata, CD_MTEXPOLY); + if (layernum_dst == 0) + ED_mesh_uv_texture_add(me, name, true); + } +} + + 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); |