diff options
author | Ton Roosendaal <ton@blender.org> | 2012-11-03 18:31:28 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-11-03 18:31:28 +0400 |
commit | 5fe0bd800f81b402b86cb4e22939da6b5cf336ed (patch) | |
tree | 957043814b69d79d5cac0445929d1958af499c37 /source/blender/editors/mesh | |
parent | b59290a835bc1c5aeeec5e3a535848bd8faeadb2 (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/mesh')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 5414ba2aefb..e9906f852de 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -235,7 +235,8 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la } } -int ED_mesh_uv_loop_reset_ex(struct bContext *C, struct Mesh *me, const int layernum) +/* without bContext, called in uvedit */ +int ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum) { BMEditMesh *em = me->edit_btmesh; MLoopUV *luv; @@ -338,7 +339,6 @@ int ED_mesh_uv_loop_reset_ex(struct bContext *C, struct Mesh *me, const int laye BLI_array_free(polylengths); DAG_id_tag_update(&me->id, 0); - WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); return 1; } @@ -348,7 +348,11 @@ int 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); - return ED_mesh_uv_loop_reset_ex(C, me, layernum); + int retval = ED_mesh_uv_loop_reset_ex(me, layernum); + + WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); + + return retval; } /* note: keep in sync with ED_mesh_color_add */ @@ -419,7 +423,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s /* don't overwrite our copied coords */ if (is_init == FALSE) { - ED_mesh_uv_loop_reset_ex(C, me, layernum_dst); + ED_mesh_uv_loop_reset_ex(me, layernum_dst); } DAG_id_tag_update(&me->id, 0); |