diff options
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index d068a394089..fbf4575e1e3 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -45,6 +45,7 @@ #include "DNA_linestyle_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" #include "DNA_meta_types.h" #include "DNA_movieclip_types.h" #include "DNA_mask_types.h" @@ -492,6 +493,31 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u for (i = 0; i < mesh->totcol; i++) { CALLBACK_INVOKE(mesh->mat[i], IDWALK_USER); } + + /* XXX Really not happy with this - probably texface should rather use some kind of + * 'texture slots' and just set indices in each poly/face item - would also save some memory. + * Maybe a nice TODO for blender2.8? */ + if (mesh->mtface || mesh->mtpoly) { + for (i = 0; i < mesh->pdata.totlayer; i++) { + if (mesh->pdata.layers[i].type == CD_MTEXPOLY) { + MTexPoly *txface = (MTexPoly *)mesh->pdata.layers[i].data; + + for (int j = 0; j < mesh->totpoly; j++, txface++) { + CALLBACK_INVOKE(txface->tpage, IDWALK_USER_ONE); + } + } + } + + for (i = 0; i < mesh->fdata.totlayer; i++) { + if (mesh->fdata.layers[i].type == CD_MTFACE) { + MTFace *tface = (MTFace *)mesh->fdata.layers[i].data; + + for (int j = 0; j < mesh->totface; j++, tface++) { + CALLBACK_INVOKE(tface->tpage, IDWALK_USER_ONE); + } + } + } + } break; } |