Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-10-31 16:37:36 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-10-31 16:37:55 +0300
commita6a3989617e680327bda2357fe506d86574e2618 (patch)
treec03ce3912491cdd1713043b8448b38ad92f024a6 /source/blender/editors/mesh/mesh_data.c
parent46c11c7b7dfc2fd59b1de337cb311617e111012e (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/mesh_data.c')
-rw-r--r--source/blender/editors/mesh/mesh_data.c20
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);