forked from bartvdbraak/blender
Make creating and saving previews for Lamp, World, Texture, Material and Image datablocks consistent.
- For now the larger previews are created at the same time the small preview icons are created - This brings back the previews when appending/linking
This commit is contained in:
parent
21bc4114df
commit
3db490d20f
@ -239,10 +239,19 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype)
|
||||
for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
|
||||
if (bhead->code==ofblocktype) {
|
||||
ID *id= (ID*) (bhead+1);
|
||||
if ( (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) {
|
||||
switch(GS(id->name))
|
||||
{
|
||||
case ID_MA: /* fall through */
|
||||
case ID_TE: /* fall through */
|
||||
case ID_IM: /* fall through */
|
||||
case ID_WO: /* fall through */
|
||||
case ID_LA: /* fall through */
|
||||
new_prv = MEM_callocN(sizeof(PreviewImage), "newpreview");
|
||||
BLI_linklist_prepend(&previews, new_prv);
|
||||
looking = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (bhead->code==DATA) {
|
||||
if (looking) {
|
||||
|
@ -1107,7 +1107,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
|
||||
continue;
|
||||
|
||||
if(itemptr.type && RNA_struct_is_ID(itemptr.type))
|
||||
iconid= ui_id_icon_get((bContext*)C, itemptr.data, 0);
|
||||
iconid= ui_id_icon_get((bContext*)C, itemptr.data, 1);
|
||||
else
|
||||
iconid = 0;
|
||||
|
||||
|
@ -170,7 +170,7 @@ static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSea
|
||||
continue;
|
||||
|
||||
if(BLI_strcasestr(id->name+2, str)) {
|
||||
iconid= ui_id_icon_get((bContext*)C, id, 0);
|
||||
iconid= ui_id_icon_get((bContext*)C, id, 1);
|
||||
|
||||
if(!uiSearchItemAdd(items, id->name+2, id, iconid))
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user