Josh Posted Wednesday at 05:02 PM Share Posted Wednesday at 05:02 PM @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) Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.