Custom Model Importing Guide - Modding-Haven/REEngine-Modding-Documentation GitHub Wiki
Guide by NSA Cloud
THIS GUIDE IS A WORK IN PROGRESS, IT IS NOT FINISHED YET.
Images still need to be added and wording needs improvement in some areas.
Introduction
This guide will cover everything you need to know to get started with importing custom models into RE Engine games with Blender.
The process is exactly the same for any RE Engine game, so don't worry if a different game from what you're modding is shown. All info is still relevant for any game.
I know this guide is long but trust me, reading a guide for 5 minutes is much better than trial and error for 5 hours.
Important file types:
- .mesh - Stores the model and armature.
- .mdf2 - (Material Definition File) Contains materials that the mesh file uses and the paths to textures used by those materials.
- .tex - Texture file, essentially a container for a .dds file.
- .dds - Common image format used in games.
- .chain - Defines physics for bones.
- .pfb - (Prefab) Determines what mesh, mdf, chain and other info a game object uses.
Setting Up
If you haven’t already, the first thing you need to do is extract the game files. See the Extracting Game Files guide for details on how to do that.
Required Tools
You need Blender 2.93 or higher. I recommend using 4.2.1 or higher though because certain features are only available on newer Blender versions. I will cover more on that later.
You also need RE Mesh Editor. Download it from Nexus or with the "Download RE Mesh Editor" button on the GitHub page.
You’ll need Fluffy Mod Manager to install the mod. Download it and set it up for the game you want to mod if you haven't already.
Photoshop or a comparable image editor is required. If you are using Photoshop, install the Intel DDS plugin.
If you do not have Photoshop, you can do your texture editing in any other image editor and use Paint.NET to save the edited texture as a DDS file.
RE Mesh Editor Installation
To install it, open Blender and navigate to Edit > Preferences > Addons.
If you are on Blender 4.2 click the down arrow in the top right and select Install.
For earlier Blender versions, the Install button is in the top right.
Navigate to the downloaded zip file for the addon and click Install Addon. Be sure to enable the addon by checking the box next to it.
[!IMPORTANT] If you downloaded from Nexus, make sure you check for updates after installing. You can check for updates by going to Edit > Preferences > Addons > RE Mesh Editor > "Check now for re_mesh_editor update".
[Image: check for updates]
Finding the mesh to replace
The first step is to find the mesh file for the model you want to replace. If you don't know what it’s called and there are no file ID lists online, RE Framework and EMV Engine can be used to find the mesh name.
You could of course just import each file until you find it, but that can take a long time. This method is more of a surefire way to find what you’re looking for.
Start by installing RE Framework if you haven't already. In game, open the RE Framework menu by pressing Insert and enable Developer Tools > Game Object Display. This will show the name of the object underneath it. This often matches the name of the mesh file.
In cases where the name doesn't match the mesh, you can use EMV Engine to search for that game object and find the mesh path it uses. TODO finish this part.
Setting Up Fluffy Manager Mod Folder
In Fluffy Manager click Options > Open Mods Folder. Create a folder in this directory named whatever you want your mod to be called. Make the chunk directory structure leading to the file you want to mod starting from the “natives” file.
[!TIP] A quick way of doing this is to navigate to the directory the mesh is stored in File Explorer. Click the address bar at the top, highlight the directory path starting at the “natives” directory and copy it. Shift right click in an empty area in your mod folder, click “Open PowerShell Window Here”. In the console window that pops up, enter “mkdir”, press space, then right click to paste the path. Press enter and that will create the full directory structure instantly.
[Image: PowerShell and directory]
Importing the mesh file
Now that you've found the .mesh file, it's time to import it into Blender. Import the mesh file by going to File > Import > RE Mesh. By default, the .mdf2 file will also be imported along with the mesh.
[Image: Import menu]
If you’re using Blender 4.1 or higher, you can also drag and drop the mesh file onto the 3D view to import it.
Custom Mesh Importing
Import your own model. The goal right now is to rig your model to the armature of the mesh you want to replace. This guide will not cover rigging in depth. There are plenty of tutorials on YouTube that can do a better job of explaining it than I can. However, I will explain enough to get you most of the way there.
You want to edit your model so it matches the proportions of the original mesh. The closer it matches the original, the better it will work.
[Image: Finished pose]
If you’re doing a weapon model or something with simple weights, you can disregard most of the rigging related info. Just be sure your model is in the same location and is weighted to the same bones as the the original model.
[Image: Weapon model example]
Posing your model
Pose Mode Keyboard Shortcuts
- G - Move bone location
- R - Rotate bone
- S - Scale bone
You can hold Alt and press the above buttons to reset any transforms you made to selected bones. Pressing X,Y, or Z will perform that operation on that axis. Pressing the axis button twice will make it move relative to the bone’s orientation.
Enter pose mode and adjust your model’s pose until it matches the mesh you’re trying to replace. Make sure the joints such as the elbows, hip and knees are in the same location as the original armature.
[!TIP] Enabling X Axis mirror can make posing quicker if your model's armature works with it.
[!WARNING] Do not change the location of non physics bones in the RE Engine armature. Moving non physics bones may cause issues with animations.
Reshaping your model
Once you’ve got the pose about right, you can edit the model’s proportions if necessary.
There are many ways to reshape your model, These are just some ways of doing so.
- Proportional editing - In Edit Mode, press O to enable proportional editing. Use the scroll wheel to adjust the selection falloff. This makes it easy to reshape the model however you want.
- Lattice modifier - Add a lattice object around your entire mesh. Add a lattice modifier to each object on your model and set the lattice value to the lattice object you made. In edit mode, you can drag the lattice points around to reshape the model. Increase the lattice resolution as you need to make more detailed edits. This method is great because it's non destructive, meaning you can go back and make changes whenever you want.
- Sculpt mode - This is another good option for reshaping, make sure dyntopo or any options that change topology are disabled though. These options do not work well with meshes that need to be used in games.
[Images for each method]
Once you have your model posed and reshaped, it's time to transfer it to the RE armature. Before you do that, you should save the blend file with a different name so you can come back to this point in case you need to adjust the posing a bit.
If your model has physics bones, duplicate the armature with Shift + D, delete all bones on the duplicated armature except for the physics bones and set it aside for now, it will be needed later.
[Image: Separated chain bone armature]
Rigging Basics
Here’s a quick explanation on weights in case you're new to Blender. Weights determine how closely vertices will follow a bone on an armature. Weights are stored as vertex groups on each object and can be found in the mesh properties panel. Each vertex group corresponds to a bone on the armature. The more red the weight is, the more influence that bone has on the mesh. For the end result, you want your model to move correctly when you move a bone on the armature.
[Image - Good/bad weight comparison]
Before starting on rigging, do the following things:
- Select all of your model's objects and press Ctrl + A Apply Transforms
- On each object, apply Armature modifier in the modifier tab.
- Select all of your model's objects and press Alt + P > Clear Parent > Keep Offset
- This will ensure your model has no armature assigned which will cause issues when transferring to the new armature. If you did it correctly, the model should stay in the same position and pose when you delete the armature.
Select all of the meshes of your model, then select the RE armature last. Press Ctrl + P > Armature Deform to parent your model to the RE armature. Do not use the automatic weights option.
[Image: Armature Deform option]
There’s two methods that are usually used to get started on rigging a model to another game’s armature.
One method is to compare the vertex groups of the original model and your model and rename your model’s vertex groups to similar vertex groups. You can combine the weights of vertex groups using a Vertex Weight Mix modifier. This can be useful if the skeletal structure is slightly different and you need to add weights together. If you’re porting more than one model from a game, this method is great because it can be done through scripting. It’s beyond the scope of this guide though so I won't cover it here.
[Image: Comparing similar vertex groups]
The other method is using Transfer Weights. I recommend to join all meshes of the original mesh file by selecting all of them and pressing Ctrl + J. This will give better results.
[!NOTE] If your model has physics bones, lock their vertex groups to prevent them from being changed by clicking the lock icon next to them in the vertex groups list.
To transfer weights, first select the merged original mesh, then the mesh you want to transfer it to. Change to Weight Paint mode. Select Weights > Transfer Weights. Change the mode to Nearest Face Interpolated. Set the layer mode to By Name.
[Image: Transfer weight settings]
The closer in shape your model is, the better it will work. After the weights are transferred, check each vertex group and erase any weight that shouldn't be there. In particular, between the legs and underarm areas usually get weights that need manual fixing. Change the model’s pose to find areas with issues.
The best approach is to use a combination of these two methods. Rename the existing vertex groups and transfer weights for any vertex groups that don't match the original model well. This saves lots of time by not having to weight the more difficult things like hands. It's not a way to skip rigging however. There’s no avoiding doing at least some manual weight painting if you want your model to look good.
Be sure that you limit the total amount of weights to 8 (Weights > Limit Total) and normalize all weights. (Weights > Normalize All). You can also press the Limit Total and Normalize All button in RE Toolbox to do this on all meshes at once.
Also check to make sure you don't have any zero weight vertices. These are vertices that don't have weights assigned and won’t follow the bones properly. You can find these by setting zero weights to all in the overlay settings and moving bones around. If there's zero weights, certain vertices will not move with the armature and cause spikes to show up when you move it.
[Image: Zero weight vertices example]
If you have a physics bones armature that you separated earlier, select the physics bones armature and the RE armature in that order. Press Ctrl + J to join the armature. If you did it correctly, the armature should still be named whatever the name of the mesh file is named. Parent the starting bone for each physics bone chain to whichever bone is most similar to the original bone chain parent. To do this, go into Edit Mode and select the starting bone for each physics bone chain, then select the parent bone and
parent with Ctrl + P > Keep Offset. Setting up chain physics will be covered later. For now the physics bones will just be static.
Rules for RE Engine Meshes
There are a couple of “rules” that you have to keep in mind with RE Engine meshes.
Each sub mesh can only have one material assigned to it. Separate your mesh by material in edit mode by pressing A to select all, then P to separate by material. Each sub mesh must be renamed to follow the RE Engine naming scheme.
Group_X_Sub_Y__MaterialName
-
Group number determines when the mesh will be visible. The function of the group number varies depending on the mesh file. Look at group numbers used for the original meshes to determine what the group number does. Setting the group number to 0 will make the mesh always be visible.
-
Sub number is used to prevent duplicate mesh names from happening. It doesn’t matter and can be set to anything.
-
MaterialName is the name of MDF material that the sub mesh will use. The material name is separated by two underscores.
[!NOTE]
The shader graph/Blender material has no effect on the exported mesh.
Example sub mesh name: Group_0_Sub_1__pl307_body
The names of the MDF materials on the end of the sub mesh names must match to materials in the MDF file. You can duplicate or add MDF materials from presets if you need more material slots.
With the rules listed above in mind, rename each object on your model so that it follows the RE naming scheme. Set the material name on the end of each object name to whatever you want materials to be named.
[Image: Show original and renamed mesh names]
Testing In Game
Before configuring materials and setting up textures, it’s worthwhile to test the model in game to verify things are working properly.
Export the .mesh and .mdf2 files with File > Export > RE Mesh/MDF into your Fluffy mod folder at the same path they were at in the chunk file. Use the default settings. You may have to set the Target Collection in the export options if you imported more than one mesh file. Set it to the .mesh/.mdf2 collection that you want to export.
Start up the game and check your model. If everything correct, you should see your model. The textures won’t look right but that’s okay. The important part is that there's no major rigging issues and no meshes are invisible or have a checkerboard texture. If you have checkerboard or invisible meshes, that means the materials in the mesh and the MDF files do not match. If this happens, export the MDF again and check the console in Window > Toggle System Console. It will tell you what materials are missing from the mesh or MDF.
[!NOTE]
Some games such as Resident Evil use multiple mdf files per mesh depending on which section of the game you’re in. Be sure to replace these as well or you will get checkerboard textures during certain parts of the game.
[Image showing alternate mdfs]
Texture and Material Setup
Now that you’ve checked your model in game and confirmed it works, it's time to set up your textures to be used in RE Engine.
PBR Materials Introduction
RE Engine uses a PBR system for rendering materials. These are the main texture types you need to know.
Albedo
Determines the color of the model.
[Image - Albedo map example]
Texture Types - ALBD, ALBM
Normal
Stores surface normals that affects how light interacts with the model. Makes the model appear more detailed than it really is.
[Image - Normal example]
Texture Types - NRMR,NRRT,NRRC
Roughness
Affects how glossy a material appears. The darker the area, the glossier it’ll appear.
[Image - Roughness min max example]
Texture Types - NRMR, NRRT,NRRC
Dielectric/Metallic
Determines how metallic a texture should appear. Dielectric is an inverted metallic map.
[Image - Metallic min max]
Texture Types - ALBD, ALBM
Alpha
Controls transparency of model. Requires the Base Alpha Test flag in the MDF or specific materials to function.
[Image alpha example]
Texture Types - ALBA, ATOS, ATOC
Ambient Occlusion
Makes shadows appear more detailed on your model.
[Image - AO on off example]
Texture Types - ATOS, ATOC,OCTD
Cavity
A more specialized AO map, used for wrinkles in cloth and skin.
[Image - Cavity on off example]
Texture Types - NRRC, ATOC,OCTD
Converting Textures to RE Engine Layouts
The goal for this step is to rearrange the color channels for each of your textures into the corresponding RE Engine texture. Texture layouts of other games can vary greatly from RE Engine’s layout. Therefore this step is something you'll have to figure out for yourself.
[!TIP] For info on how color channels are laid out for each texture type, see the Textures Guide
You can find what texture types you need to make by checking the Texture Bindings section of the MDF material. [Image showing texture bindings]
You can see here that an ALBD, NRMR and ATOC textures are needed. Note that you don't need to make textures for all texture bindings, only for ones that have textures unique to the model you're replacing. Most of the time you will only need to replace the ALBD, normal and ATOS/ATOC textures.
The channel layout of a texture is pretty self explanatory. The texture type on the end is often indicative of how the channels are arranged. For example, ALBD stands for Albedo Dielectric, meaning the R,G,B channels are color and the alpha channel is Dielectric. ATOC stands for Alpha, Translucent Occlusion Cavity and so on.
Photoshop is the preferred image editor to use because of it's ability to rearrange color channels and the fact that it has a functioning DDS plugin. However, you can use any image editor with similar features.
Install the Intel DDS Plugin for Photoshop to be able to open and save DDS files. Do not use the Nvidia DDS plugin, it lacks the ability save as sRGB and Linear DDS files.
[Image showing color channels tab]
Open up the texture you want to bring into the game. You can access color channels with Photoshop by changing from layers to channel editing mode in the bottom right. Press Ctrl A to select everything in a channel, Ctrl C to copy, Ctrl V to paste it.
Save your edited texture as DDS into your texture folder. Set the compression to BC7 sRGB if you're saving an albedo texture or BC7 Linear for anything else. You can name your textures anything you want since we’ll be setting custom texture paths later.
[Image showing compression settings]
MDF Editing
Find the MDF collection in the outliner.
[Image - mdf collection circled]
For each material, change the texture binding entries to the names of your textures. Set a custom path to anywhere inside the natives folder. Note that all texture paths should be relative to the natives/STM/ folder.
[Image showing a correct path and incorrect path]
[!WARNING] Do not leave paths blank. If you don’t have a texture for a specific map, either leave it as is or use one of the null textures in the systems/rendering folder.
Tex Conversion
Once you’ve set all of the texture paths in the MDF, it's time to convert the textures into tex files. In the RE MDF Tools panel, set the Image Directory to the directory you saved your textures in. Set the Mod Directory to the natives/STM folder inside your Fluffy mod folder. Press the Convert Directory to Tex button. Note the amount of textures it says were converted at the bottom. Then press the Copy Converted Tex button.
This will copy the converted tex files into your mod directory based on the texture paths you have set in the MDF. If your texture paths are all set, the number of textures copied at the bottom should match the number of textures converted.
[!NOTE]
You can also convert DDS files to Tex and vice versa by dragging and dropping them onto the 3D View if you're on Blender 4.1 or higher.
[!TIP] If you want to apply the MDF materials to the model in Blender, use the "Apply Active MDF" button. This is purely for previewing in Blender and has no effect on exported files.
Export your MDF. In game, you should see your textures on the model. If the model or the game does not load, you have incorrect texture paths set in the MDF.
[Image model with textures applied]
That's everything! You're done now, unless you have physics bones to set up. In which case, continue reading.
Basic Chain Physics Setup (Optional)
If your model has physics bones that you added to the armature earlier, now’s the time to set them up. If you don't want to add physics to your model, skip this step.
This step requires RE Chain Editor, you can download it here by pressing the Download RE Chain Editor button.
Create A Chain Header
Instead of importing a chain file (which can be done from the File > Import menu), we will be creating one from scratch. Start by pressing the “Create Chain Header” button in the RE Chain tools panel. Make sure you’re in Object Mode or it won't show up. Name it the same name as the mesh (or whatever the existing chain file is called). This object stores certain settings such as calculation time and quality. For the most part, the default settings will work for everything so you don't really need to make any changes to it.
[Image showing chain header in outliner with settings]
Assigning Chain Groups
Next we’ll designate what bones should have physics. To do that, you need to be in Pose Mode. You can use the “Switch To Pose Mode” button in the RE Chain panel to automatically select the armature and switch to pose mode with one click.
For each bone chain that you want to have physics, select the first bone in the chain and select “Chain From Bone”. Note that you can not have branching bones in a chain. This will create a Chain Group object that contains Chain Nodes for each bone.
Generally, the only important setting to change on a chain group is the Attribute Flags. This value determines what features a chain can use, such as whether it has collisions or follows angle limits. This value varies from game to game and certain values will work in some games and not others. There is a drop-down list that contains known values for each game. You may have to change this value as the default value may have issues with the game you're modding.
[Image showing attr flags dropdown]
Each bone in a chain has a corresponding Chain Node. These determine the range in which a bone can move in.
[Image showing chain node with each setting highlighted]
Some important settings to be aware of are:
- Angle Limit Radius - The amount in degrees a bone can deviate from it’s starting direction.
- Angle Limit Direction - Every chain node has a corresponding _ANGLE_LIMIT object. This determines the direction the angle limit cone faces in.
- Collision Radius - Determines how large the collision sphere for each node is.
- Collision Filter Flags - Determines what the nodes can collide with. If you are having issues with nodes not colliding, this value is a likely cause. Don't bother setting angle limits yet. It will be covered in more detail later.
Assigning Chain Settings to Groups
Chain Settings determine how a chain group behaves.
In order for chain groups to function, they need to be parented to a chain settings object. Switch back to Object Mode, press the “Create Chain Settings” button. Create a chain settings object for as many things that need to behave differently. For example, with long hair, you would want two or more sets of chain settings. The bangs in the front shouldn’t be as floaty as the hair in the back for example.
These are the most commonly used settings:
[Add videos for each chain setting with low med high values]
You can use presets to make setting up chain settings much quicker. Just select a preset from the list in the RE Chain tab, select your chain settings object and press “Apply Chain Settings Preset”.
[Image showing preset menu]
In the outliner, select each chain group, then select the chain settings object and press Ctrl P > Keep Offset to parent it to the settings. You can also drag the groups onto the chain settings while holding shift to parent it. This will assign the selected groups to use the chain settings.
[Gif showing chain groups being dragged onto settings]
Adding wind physics (optional)
[Image showing wind physics]
If you want your chains to be affected by wind, create a Wind Settings object with the ”Create Wind Settings” button in the RE Chain tab. Parent the chain settings to the wind settings object you created. This will make the chain settings be affected by the wind settings. The settings are fairly self explanatory. There are two different wind types you can pick, local wind and global wind. Global wind is affected by wind currents on the stage you’re on. Local wind is not affected by stage wind.
Adding chain colliders (Optional)
[Image showing colliders]
To prevent clipping through your model, you can create colliders for chain nodes to collide with. To create collisions, switch to Pose Mode. You also can do that with the “Switch To Pose Mode” button in the RE Chain tab.
Select the bone you want to attach collision to. If you select one bone, a collision sphere will be created. If two bones are selected, a collision capsule will be made instead. These two shapes are usually sufficient for anything you need to do. Do not attach collisions to chain bones.
[Image showing capsule being scaled]
Editing collisions is pretty simple, you can move and scale collisions like any object by selecting the handles. They do have additional settings that can be configured but generally you don't need to touch them.
Verifying Functionality In Game
Before configuring angle limits, we’ll export the chain file to make sure physics are working for each bone chain. Export the chain file from File > Export > RE Chain.
In game, verify that the chains are all moving.
TODO Angle limits, chain links