How to generate transparent background thumbnails from 3D models?

Hey guys, as title, I’m trying to figure how to generate thumbnails for an inventory system.
I was expecting the editor to let me import the mesh and its material to a png image but doesn’t seem to be the case.
Please note I am not even trying to do this at runtime, it’s ok if I can just generate the images once and store them somewhere so they can be displayed as inventory icons.

Thanks in advance.

anyone ?

Simple version: Box with unlit material, you put your mesh, player pawn, light and make screenshot.

Bit longer version:

  • make unlit material with color parameter exposed. Create instanced material out of it.
  • make family of those instanced materials, or pick one color that none of your models has (for photoshop magic wand to apply alpha).
  • create pawn actor.
  • it should have camera, static mesh and lights
  • create array of static meshes that you want tumbnails
  • create array of colors for background if you need more than single color
  • and maybe you need different light settings, so create array for lights and their locations etc.
  • make keybindings and events for circling trough meshes, background colors and light setups
  • make one extra binding for screenshot, there should be console command for it and there is node in blueprints to run console command

Run that “game” in some resolution that lets you create nice thumbnails (like 1024x1024) for photoshop. Then scale them down to desired size. Make screenshots, find where unreal saves them.
I did such thing for reflection cubemaps. I had blueprint actor that rotated self and made all screenshots.

Put as much as you can into blueprint, so it can be repeated with exactly same conditons (like lights colors, location of camera etc) it helps when you later discover some error and you want to make single screen without redoing them all.

Ps you can always do same during runtime with scene capture.

Thanks and sorry for the delayed response, I was idle for a while.
Can you please elaborate on this method, I don’t follow.

Use the in-engine screenshot tool and enable *custom depth as mask. *Taking Screenshots | Unreal Engine Documentation lets you take renders of in-game assets and you can, in simplest terms, green-screen out the background

2 Likes

Very useful thanks!

Can anyone answer me this

Great, Thank you :grinning: