Anybody know if it's possible to change the thumbnail size? The red is easy by doing col.template_icon_view(brush, "items", show_labels=True, scale=8) ,but I'm trying to figure out the green.

enter image description here

Found icon_size and image_size ,but can't get anything to happen with those.


def preview_items(self, context):        
    enum_items = []
    # Valid file extensions   
    extensions = ('.jpeg', '.jpg', '.png')
    if context is None:        
        return enum_items
    directory = "C:\\Users\User Name\Desktop\thumbnails\\"  
    pcoll = preview_thumbnails_collections["main"]

    if directory == pcoll.my_previews_dir:
        return pcoll.my_previews
    if directory and os.path.exists(directory):
        image_paths = []
        for fn in os.listdir(directory):
            if fn.endswith(extensions):

        for i, name in enumerate(image_paths):
            filepath = os.path.join(directory, name)
            icon = pcoll.get(name)
            if not icon:
                thumb = pcoll.load(name, filepath, 'IMAGE')
#>>>>>>>>>>>>>> Neither does anything, just makes thumbnails not show ????
                thumb.image_size = (350, 350)
                thumb.icon_size = (350, 350)                
                thumb = pcoll[name]
            enum_items.append((name, name, name, thumb.icon_id, i))
    pcoll.my_previews = enum_items
    pcoll.my_previews_dir = directory
    return pcoll.my_previews

OK, finally figured this out by looking at source code. You use scale_popup=8 for the green part and scale=8 for the red part.



You must log in to answer this question.

Browse other questions tagged .