Bake a portrait¶
Designer · 30 min · No code
Result: a party member has a portrait of their own, cut out on a transparent background. It shows on their HUD plate, on the Party screen and in the equipment screen's character strip. A second, full-body menu portrait fills their card on the main menu.
Before you start¶
- Add a party member: you need a member definition to set the portrait on.
- An image editor that can crop and save PNG with transparency.
Any image in the right shape works. This page shows how to render one with the editor's built-in tools.
What a portrait must be¶
| Property | Value | Why |
|---|---|---|
| Size | 320 × 384 pixels (5:6), as the samples | Larger than any box it is drawn in; mipmaps scale it down cleanly |
| Background | Transparent (alpha) | The plate draws the portrait over its own frame and shadow |
| Framing | Head and neck, facing the camera | The HUD box is small; the samples are framed close on the face, and a waist-up bust is hard to read |
| Texture Group | UI | Loads at full resolution and never streams down |
Steps¶
1. Render the character in the editor¶
Skip to step 2 if you already have artwork.
- Create an empty level (File › New Level › Empty Level) with one directional light and a
Sky Light. Save it in a scratch folder of your own, such as
MyGame/WorkLevels: it is a work level, not game content. - Drag your pawn Blueprint into the level, or for a VRoid member drag its skeletal mesh.
- Select its mesh component. Set Animation Mode to Use Animation Asset and pick an idle,
for example
MM_Unarmed_Idle_Readyfrom Lyra's Mannequin animations (or theMF_version for a feminine character), so it is not in a T-pose. - Under Rendering, tick Render CustomDepth Pass. This is what lets the screenshot tool cut the character out.
- Place a Camera Actor facing the character at head height and pilot it (right-click › Pilot). Frame head and shoulders.
- Open High Resolution Screenshot... from the viewport's camera menu (the one labelled
Perspective). Tick Use custom depth as mask, set Screenshot Size Multiplier to
2or more, and click Capture.
The image lands in your project's Saved/Screenshots folder with the background transparent.
2. Crop it¶
- Open the PNG in your image editor.
- Crop to a 5:6 rectangle around the head, and scale to 320 × 384.
- Check the edge of the silhouette on a light background. If it has a dark fringe, feather or defringe the edge by one pixel.
- Save as
T_Portrait_Rook.png.
3. Import it¶
- Drag the PNG from your file browser into the Content Browser folder
MyGame/Party/Portraits. - Open the texture and set:
- Texture Group: UI
- Compression Settings: EditorIcon, as the samples (uncompressed, keeps a clean alpha edge)
- Mip Gen Settings: SimpleAverage, so the portrait scales down without aliasing
- Filter: Trilinear
- Save.
4. Set it on the character¶
- Open the character's member definition, for example
PartyMember_Rook. - Under XenoCore › Party, set Portrait to
T_Portrait_Rook. Save.
5. Optional: a menu portrait¶
The main menu shows each active member as a full-height card. It uses Menu Portrait (on the same member definition); left empty, the card falls back to Portrait.
- Render the whole body as in step 1, standing in an idle, facing the camera.
- Crop to 600 × 1720 pixels with the crown of the head near the top and the body centred on the
head. The card shows only the top part of the image (Portrait Crop
0.55on the card, roughly crown to hips) and fills its height, so a head placed lower is cut off at the waist. Portrait Crop is a setting of the card itself, not of your texture; you never need to change it. - Import it with Texture Group UI, Compression Settings BC7 (it is much larger than a HUD portrait), Mip Gen Settings SimpleAverage and Filter Trilinear.
- On the member definition, under XenoCore › Party, set Menu Portrait to it. Save. The
samples are
Characters/VRoid/<Name>/T_XenoCore_MenuPortrait_VRoid_*, for exampleCharacters/VRoid/Kael/T_XenoCore_MenuPortrait_VRoid_L.
The HUD samples are in Characters/Party/Portraits, for example T_XenoCore_Portrait_Blue: open one
to compare your import settings.
Test it¶
- Open
Maps/L_XenoCore_Gymand press Play with the character in the active party. - Their HUD plate shows the new portrait, cut out cleanly against the plate.
- Open the menu: the character's card shows the menu portrait. Check the Party screen and the equipment screen's character strip too.
If it doesn't work¶
The portrait shows a black or grey box around the character
The PNG has no transparency, or the texture's alpha was stripped on import. Check the texture editor's alpha channel view. Re-export with transparency.
The portrait is blurry
The texture is streaming a lower mip. Set Texture Group to UI and tick Never Stream.
The leader's HUD plate still shows the old face
The plate for the character you control reads the same Portrait field. If it does not change, you are testing from a save or the definition was not saved.
Re-make the portrait when the character changes
A portrait is a picture, not a live render. Change a character's materials and the old portrait still shows the old colours.
Going further¶
- Add a party member
- Restyle the menus: the HUD plate's frame and shadow around the portrait.
- UI shell and HUD