Editing .PLG files in P5(R)


If you’re deeply entrenched in modding Persona 5, chances are you’ve come across the .PLG format. It’s used for vectorized UI elements, usually large ones, to prevent jagged edges when rendering at high resolutions.

Thanks to zarroboogs, we have a Blender plugin that allows you to import them as meshes and export them as .PLG. You can even change the color of some of them, if the game allows for it.

Using the Plugin

To get started, download the GitHub repository for io_plg as a .ZIP.

In Blender, go to Edit > Preferences > Add-ons > Install and choose the .zip.

Check the box to the left of “Import-Export: PLG Format” and close the Preferences.

Now, go to File > Import and you can choose .PLG as an import format!

Editing a .PLG

There’s some setup involved for getting the desired results in-game and avoiding errors when exporting. In this example, I’ll be making a custom Joker active battle portrait background.

First, I’ll locate it in the game’s files.

BATTLE_ACTIVE_PP.PLG is the background for active party member stats in battle.

Once located, each element of the PLG becomes an individual mesh in the collection added to the scene. For now, I’ll hide all the ones I don’t need.

BATTLE/GUI/P5_BATTLE_PARTYPANEL.SPD contains the textures for the party member panels

Next, I need to use a reference for how the texture appears in-game. I’ll use Amicitia to export the battle UI textures as PNG from an SPD.

In an image editor, I’ll add a background so I can see the texture better, and crop only the active battle texture for the character I’m working with, then save as a new texture.

Next, in Blender, I’ll ad a new plane and increase the size to about 300m so I can see it.

We can give it a material and use the texture as the base color (change the viewport shading to Material to see it), but there won’t be any transparency yet.

In the Shading tab, let’s connect the alpha of the image to the alpha of the material. In the material pane’s settings, let’s also change the blend mode and shadow mode to alpha. Now it should show up transparent in the viewport.

Finally, I tried my best to roughly scale and position it to match a reference screenshot from the game. It doesn’t have to be perfect, but should give you an idea of what you’re working with.

Now I’ve replaced the active party texture with the one for my custom character so it’s easier to see what needs to be edited. Since this one is shaped close enough to joker, I can get away with going to Edit Mode with the PLG mesh selected, and simply moving the vertices around to match.

…Or so I thought. You can’t have overlapping vertices like this or else the exporter will throw errors, so it looks like we will be recreating the mesh from scratch. Fortunately, the creator of the plugin laid out a guide on how to do that.

Let’s add yet another tiny plane mesh, keeping it at 1.5m size and moving it to the area where we want to start building our shape.

In edit mode, select the vertices on the edge of the object and press E to extrude. Keep doing that until you have drawn an edge all the way around the perimeter of the object in the desired shape. Be careful not to let any edges cross.

Once I’ve filled out a shape that I like and made sure no edges are crossing, the next step is to join the vertices.

Select the vertices you want to merge and press M and choose “at center.”

Now, I’ve changed the selection mode to “Face” and pressed the A key to select all faces of the plane. Then, I pressed CTRL+T to triangulate the faces. Now all that’s left is to fill in the gap inside!

Next, with everything still selected, I’ve pressed the F key to fill the interior of the shape with faces.

Pressing Ctrl+T again, I can triangulate those inner faces. Our mesh is now complete!

Press A to apply any transformations, and go back to object mode. Make sure the location is set to 0,0,0 (if not, then move it there). You can use edit mode to reposition it while keeping the origin at 0.

As my final step, I deleted the original mesh/object, renamed the new mesh to the original mesh/object’s names, and added it to the PLG’s collection. Now we’re ready to export! Make sure you have clicked on the PLG collection before exporting.

On the right side of the export window, you can keep auto-color checked to make the exported meshes white, or uncheck to use custom vertex colors (which only works when the game actually checks those).

The “mystery bytes” option changes the header size of the PLG. For P5, there’s a few different ones in use for different files. You can check the original file in a hex editor if you’d like, but most of the time you can ignore this setting unless you have issues loading your .PLG ingame.


Leave a Reply

Your email address will not be published.