My first: Custom portrait

From Divinity Engine Wiki
Jump to: navigation, search

Description

The icons for characters in Divinity: Original Sin 2 are rendered by the portrait renderer, in the editor. Although fully automatic, the portrait renderer requires some setting up to know which portraits to render.

This article will not be going over creating a new character root template. If you do not yet know how to create a character root template, I recommend you read My first: Character first.


Rendering a character portrait

Step 1: the photobooth level

In order to render character portraits, we will need a photobooth level. The photobooth level is a level that contains photobooths for each character for which an icon is rendered. Each photobooth consists of a background plane, lights, a point trigger and a spectator trigger. The spectator trigger is the camera from which the icon will be rendered.

First, we will open the SYS_NPC_Portrait_A level, which is inherited from the Shared project. We could create a photobooth level from scratch, but using an existing one is easier, as it allows us to copy an existing photobooth.


Step1 OpenPhotoboothLevel.png

Opening the SYS_NPC_Portrait_A level


To open the photobooth level, check the "Show Inherited Levels" toggle (1). Then, navigate to the "SYS" folder (2) and select (or double click) the SYS_NPC_Portrait_A level (3). With the level selected, click "Select" to load (4).

If you can not see anything in the level, try changing your work atmosphere trigger, as the default level atmosphere for the photobooth level is very dark.

Next, we need to set the level as our project's default photobooth level.


Step2 ConfigureProjectProperties.png

Setting the photobooth level for this project


To set the photobooth level of your project, go to the Project settings window (under Project > Project Settings...) and navigate to the "General" tab (1).

In the general tab, click the [...] button next to "Photo Booth Level" (2) and select your photobooth level (SYS_NPC_Portrait_A). If the level is set correctly, hit "Save" back in the project settings window (3).

We can now render portraits for our level. However, the portrait texture atlas will be empty, as we have not yet defined any templates to render.


Step 2: setting up the photobooth

Step3 CopyingPhotobooth.png

Copying a photobooth for our own root template

First, copy an existing photobooth by selecting it (lights, background, camera trigger and point trigger) (1), enabling the translate interaction mode (2) and shift-dragging it along the X-axis (3).

Next, we will customize the copied photobooth.



Step4 SetupPhotobooth Trigger.png

Setting the name of the photobooth's point trigger


The portrait renderer needs the location where your character will stand when the portrait is rendered. For this, it uses the point trigger we copied.

To rename the point trigger, select it (1) and change its name in the Sidebar (2). I named my point trigger Icon_Goblin_Wayfarer.


Step4 SetupPhotobooth Camera.png

Copying a photobooth for our own root template


We will also need to name our camera trigger. Select the camera trigger (1) and change its name to to Cam_{PointTriggerName} (replace {PointTriggerName} with the name you gave the point trigger) (2). I named my camera Cam_Icon_Goblin_Wayfarer.


Step4 SetupPhotobooth Character.png

Copying a photobooth for our own root template


The last thing we need to do is set up the character whose portrait will be rendered. My character is created from a root template named Creatures_Goblins_Wayfarer, a copy of the Creatures_Goblins_Grunt_A template with a custom visual set.

Create an instance of the character in the photobooth level with the InteractionMode Creation.png creation interaction mode (1), select it (2) and change its "Portrait Generation Trigger" property to the name of your point trigger in the sidebar (3). I set the value of the property to Icon_Goblin_Wayfarer.

Our photobooth is now all set up! It's time to render the portrait.


Step 3: rendering

Step5 RenderPortraits.png

The "Render Character Portraits" button


Finally, start the portrait render by clicking "Render Character Portraits" under the "Project" menu in the menu bar.

If the render is successful, your character should now have a portrait icon! Make sure to copy the icon property from the character back to the character's root template so it applies to all instances of that template.


Step6 RenderPortrait Result.png

The resulting character portrait



Notes

  • Portraits that exist in inherited projects will not be re-rendered, making it impossible to render icons for existing templates. However, it is possible to create a new photobooth with a copy of the root template you wish to modify, render the icon for that template, and then assign the rendered icon to the original template.
  • The photobooth level is very dark, make sure to use a custom work atmosphere.
  • Characters need to have a visual set in order to be included in the portrait render