diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-16 16:19:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-16 16:19:02 +0400 |
commit | 008f0e73eefb8496da0a5a5196681e0164216ad7 (patch) | |
tree | d168f390e25acc56338d6307490c3d6b9e9aa43c | |
parent | f241451d1743afb1b2d9453c45a2529a58efb745 (diff) |
bmesh todo. making an image local wasn't dealing with mesh polygon texface data.
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 43 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_mirror.c | 2 |
2 files changed, 42 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 584efc2d3da..f848ee3a676 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -327,8 +327,6 @@ static void extern_local_image(Image *UNUSED(ima)) match id_make_local pattern. */ } -/* BMESH_TODO - MTexPoly, currently this function only does 'me->mtface' */ - void make_local_image(struct Image *ima) { Main *bmain= G.main; @@ -384,6 +382,25 @@ void make_local_image(struct Image *ima) } } } + + if(me->mtpoly) { + MTexPoly *mtpoly; + int a, i; + + for(i=0; i<me->pdata.totlayer; i++) { + if(me->pdata.layers[i].type == CD_MTEXPOLY) { + mtpoly= (MTexPoly*)me->pdata.layers[i].data; + + for(a=0; a<me->totpoly; a++, mtpoly++) { + if(mtpoly->tpage == ima) { + if(me->id.lib) is_lib= TRUE; + else is_local= TRUE; + } + } + } + } + } + } if(is_local && is_lib == FALSE) { @@ -445,6 +462,28 @@ void make_local_image(struct Image *ima) } } } + + if(me->mtpoly) { + MTexPoly *mtpoly; + int a, i; + + for(i=0; i<me->pdata.totlayer; i++) { + if(me->pdata.layers[i].type == CD_MTEXPOLY) { + mtpoly= (MTexPoly*)me->pdata.layers[i].data; + + for(a=0; a<me->totpoly; a++, mtpoly++) { + if(mtpoly->tpage == ima) { + mtpoly->tpage = ima_new; + if(ima_new->id.us == 0) { + mtpoly->tpage->id.us= 1; + } + id_lib_extern((ID*)ima_new); + } + } + } + } + } + me= me->id.next; } } diff --git a/source/blender/bmesh/operators/bmo_mirror.c b/source/blender/bmesh/operators/bmo_mirror.c index 29a74b9f02a..82e77fc9a96 100644 --- a/source/blender/bmesh/operators/bmo_mirror.c +++ b/source/blender/bmesh/operators/bmo_mirror.c @@ -69,7 +69,7 @@ void bmesh_mirror_exec(BMesh *bm, BMOperator *op) BLI_array_growone(vmap); vmap[i] = v; - /* BMESH_TODO, double check this is being made dirty, 99% sure it is - campbell */ + /* BMESH_TODO, double check this is being used, calling following operators will overwrite anyway - campbell */ BM_elem_index_set(v2, i); /* set_dirty! */ v2 = BM_iter_step(&iter); |