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:
authorTon Roosendaal <ton@blender.org>2012-11-03 18:31:28 +0400
committerTon Roosendaal <ton@blender.org>2012-11-03 18:31:28 +0400
commit5fe0bd800f81b402b86cb4e22939da6b5cf336ed (patch)
tree957043814b69d79d5cac0445929d1958af499c37 /source/blender/editors/uvedit/uvedit_ops.c
parentb59290a835bc1c5aeeec5e3a535848bd8faeadb2 (diff)
Bugfix (own collection)
Adding new image texture to Meshes didn't initialize UVs to 0-1 default. This makes initial display of textures on meshes not work. This fixes my favorite demo case: Open Blender, drop image from desktop on cube.
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_ops.c')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 4b008d9a30f..e860d486ea3 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -215,6 +215,8 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
if (!CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) {
BM_data_layer_add(em->bm, &em->bm->pdata, CD_MTEXPOLY);
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));
update = 1;
}