-
Notifications
You must be signed in to change notification settings - Fork 5
Mesh editing
Content Editor supports full import and export of meshes using intermediate formats (.fbx, .glb, .gltf) authored by any 3D modelling tools. It can open all valid RE .mesh files and any of the previously listed formats.
The 3D mesh viewer scene can be navigated by holding the right mouse button and moving the mouse and pressing the WASD keys. The camera type can be switched through the Controls toolbar menu as well as some other parameters.
The material file path is guessed based on the mesh file path, but can be manually changed to display a different .mdf2 file instead. The viewer currently only accounts for the albedo color texture, the rest are ignored.
Some meshes are split into multiple meshes (most commonly body, head, hair for playable characters) where having only one mesh showing at a time wouldn't always be sufficient. In these cases, you can use the "Mesh collections" toolbar to load in additional meshes, as well as choose a reference skeleton to use for animations. These collections can be saved and loaded to disk for easier reuse. Editing is still limited to only the main mesh.
In addition, you can preview animations (more info here) or overlay a .rcol file's collider shapes (more info here).
Due to having to go through intermediate formats, some data might not translate 1:1 to external tooling or to the RE Engine mesh format when imported, and there might be issues with the mesh conversion library (Assimp) where some data gets converted incorrectly. To make working with these formats easier, some points to keep in mind will be mentioned below.
- With any valid RE .mesh active, open the Import / Export toolbar item.
- Some additional options are shown depending on what kind of mesh is open and whether an animation file is loaded.
- After confirming the settings, press Export Mesh. You can pick the file format from the file picker. More info regarding file formats is noted below.
There are two ways to import meshes:
Open an existing RE .mesh file that you would like to modify
- Find the mesh via PAK browser or from disk
- Open the import menu
- Adjust the import settings
- press "Import From File"
- Select your external mesh .fbx or .glb file
The mesh data is then replaced and you can use the save buttons to save the imported mesh as a RE Engine compatible .mesh file.
Import a new mesh
- Drag & drop your file into the editor or open it from the file menu
- Open the import menu
- If the import settings aren't correct, adjust them and close the file (close it via the File > Open files menu), then reopen it
- From the import menu, select the desired mesh version and press convert
- Pick a save location for the converted mesh file
- Exporting static meshes: .glb works more seamlessly, but .fbx should be fine too, just remember to set the correct import scale when using .fbx
- Exporting animated meshes (e.g. characters): .fbx (.glb omits weights past 4 weights per vertex)
- Exporting animations: prefer .glb (.fbx sometimes messes up some rotations)
- Importing anything: prefer .glb (with .fbx, weights are sometimes messed up)
Remember that you can export to .fbx, edit in blender, then export from blender as .glb and import that.
You don't have much choice other than .fbx. For importing .fbx back into Content Editor, you will most likely need to adjust the import settings. The Import scale is important, and when importing animations, the Z-Up to Y-Up axis conversion setting will likely also be required.
The importer will categorize and group up imported meshes based on their object name to fit the RE Engine mesh data structure. The engine supports 3 different types of mesh data: main mesh, shadow mesh, and separately, occlusion meshes. The main and shadow meshes can also have several LOD levels of varying quality.
Main and shadow meshes use a Group_{groupIndex} naming to mark which mesh group a mesh belongs to. Mesh group are mainly used by the game for toggling visibility of some parts of a mesh, for example to hide parts of clothing or character damage states. If the group can't be determined for a mesh, it will be put into group 0.
Shadow meshes are prefixed with the shadow_lod{lodIndex}_ prefix, while plain meshes are denoted with just lod{lodIndex}_. Anything without a lod level indicator is deemed to be part of the main mesh LOD 0.
Main LOD shadow LOD meshes can overlap in some cases by reusing the exact same mesh data. Content Editor uses the vertex and triangle count for this, so if the shadow mesh lods all contain the same number as the main lod meshes, it will directly reuse the main mesh data for shadows.
This is a special type of mesh used for occlusion culling (e.g. to prevent rendering of meshes that can't be seen through walls). This should generally be a very simple mesh with only the main wall polygon shapes and does not have any material data.
Occlusion meshes are denoted with the occ_ prefix in exported files and expect the same for import. The editor currently has no preview of these, except for looking into the mesh data section of the mesh viewer or exporting them to one of the intermediate formats and viewing from there.
Bones are exported with their original names and should work as usual. Some meshes also have some non-standard data in them, like having additional and set of weights and shape key bones, which might not behave quite like you'd expect.
Supported per-vertex weight count limits can vary across RE Engine games so you may need to keep in mind the specific game's weight limit (this can also vary within the same game depending on the chosen .mdf2, usually the material mmtr path is specially labelled in such cases).
Additional weights are exported with the WEIGHT2_DUMMY_ name prefix and attached as children of the normal bone. Similarly, shape key weights are marked with the SHAPEKEY_ name prefix. Having these behave "correctly" would require some sort of blender specific addon to be useful as far as editing them is concerned. The additional weights might need to be temporarily disabled from there.