@Andy90 When you right-click on a file in the asset browser there is an option to save the thumbnail as a PNG image.
local extension = {}
function extension.hook(event, extension)
if event.id == EVENT_WIDGETACTION and event.source == extension.menu then
if program.assetbrowser.selectedfile ~= nil then
local file = RequestFile("Save File", CurrentDir().."/", "Portable Network Graphics:png", 1, true)
if file ~= "" then
local assetfilename = Lower(StripDir(program.assetbrowser.selectedfile.path))
local n
for n = 1, #program.assetbrowser.assetdisplays do
if program.assetbrowser.assetdisplays[n].panel:GetHidden() == false then
if Lower(program.assetbrowser.assetdisplays[n].label.text) == assetfilename then
local pixmap = program.assetbrowser.assetdisplays[n].thumbnail.pixmap
if pixmap == nil then
Print("Error: No pixmap found")
return true
end
pixmap:Save(file)
break
end
end
end
end
else
Print("Error: No file selected")
end
end
return true
end
CreateMenu("", program.assetbrowser.filepopupmenu)
extension.menu = CreateMenu("Save Thumbnail", program.assetbrowser.filepopupmenu)
ListenEvent(EVENT_WIDGETACTION, extension.menu, extension.hook, extension)