I am working on an add-on that lists the materials. We are looking for a way to display a large material preview using template_preview.
Although it was possible to display it, only the material drawn for the first time is displayed repeatedly. Even if only the material index number 3 is displayed, it seems to be affected by the first template_preview used.
template_preview should have been able to obtain the names of all material lists by mat.name.
How can I get a proper listing in template_preview? Also, can I view larger material previews in a better way?
''' python
def draw(self, context):
layout = self.layout
materials = [mat for mat in bpy.data.materials]
col = layout.column(align=True)
if materials:
for mat in materials:
row = col.row()
rowc = row.column(align=True)
rowc.scale_y = .5
# Material Preview
rowc.template_preview(bpy.data.materials[mat.name], show_buttons=False)
# Material Name
rowc.label(text=mat.name)
# Material Index "3" Preview
rowc = row.column(align=True)
rowc.scale_y = .5
rowc.template_preview(bpy.data.materials[3], show_buttons=False)
rowc.label(text="Material Index 3 Preview")
'''
