return N_("Browse ID data to be linked");
}
-static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop)
+static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, short idcode, int flag, const char *newop, const char *openop, const char *unlinkop)
{
uiBut *but;
uiBlock *block;
if((idfrom && idfrom->lib) || !editable)
uiButSetFlag(but, UI_BUT_DISABLED);
}
+
+ if(idcode == ID_TE)
+ uiTemplateTextureShow(layout, C, &template->ptr, template->prop);
uiBlockEndAlign(block);
}
TemplateID *template;
PropertyRNA *prop;
StructRNA *type;
+ short idcode;
prop= RNA_struct_find_property(ptr, propname);
flag |= UI_ID_OPEN;
type= RNA_property_pointer_type(ptr, prop);
- template->idlb= which_libbase(CTX_data_main(C), RNA_type_to_ID_code(type));
+ idcode= RNA_type_to_ID_code(type);
+ template->idlb= which_libbase(CTX_data_main(C), idcode);
/* create UI elements for this template
* - template_ID makes a copy of the template data and assigns it to the relevant buttons
*/
if(template->idlb) {
uiLayoutRow(layout, 1);
- template_ID(C, layout, template, type, flag, newop, openop, unlinkop);
+ template_ID(C, layout, template, type, idcode, flag, newop, openop, unlinkop);
}
MEM_freeN(template);
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
+
+ /* XXX linking hack */
+ uiTemplateNodeView(NULL, NULL, NULL, NULL, NULL);
}
/********************************* Keymap *************************************/