Valheim
0 of 0

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

Tags for this mod

About this mod

Allows you to replace object meshes with imported model files.

Requirements
Permissions and credits
Changelogs
Donations
This mod will hopefully eventually allow replacing any mesh in the game; for now it lets you do the following:

  • Replace the static mesh(es) of building pieces with imported fbx or obj files.
  • Replace the static mesh(es) of items with imported fbx or obj files.
  • Replace skinned meshes with imported AssetBundles (experimental)

All files should be placed in subfolders in BepInEx\plugins\CustomMeshes folder (create it if it's not there) as explained below.


Building Pieces

To import static meshes for building pieces, do the following:

Step One: create a folder with the name of the thing you are replacing.

For example, to replace the wooden chest meshes, create a subfolder in BepInEx\plugins\CustomMeshes called:

piece_chest_wood


Step Two: create a subfolder for each of the states of the building piece: New, Worn, Broken

So now you should have three folders:

BepInEx\plugins\CustomMeshes\piece_chest_wood\New
BepInEx\plugins\CustomMeshes\piece_chest_wood\Worn
BepInEx\plugins\CustomMeshes\piece_chest_wood\Broken

Step Three: put fbx or obj files corresponding to each MeshFilter name into that folder, e.g.:

woodchest.fbx
woodchesttop_closed.fbx



Items

To import static meshes for items, you need the item name, the renderer object name, and either the mesh filter name or the skinned mesh renderer name, depending on the item. You can find these by turning on debug in the config file and looking at the messages when the item spawns, e.g.:

CustomMeshes got mesh filter item name: HelmetPadded, obj: HelmetPadded, mf: default
CustomMeshes got skinned mesh renderer, item name: HelmetPadded, obj: attach_skin, smr: ChainLinkVisor

You then create a file with the following folder structure:

BepInEx\plugins\CustomMeshes\<ItemName>\<ObjectName>\<MeshFilterName>.obj

and/or

BepInEx\plugins\CustomMeshes\<ItemName>\<ObjectName>\<SkinnedMeshRenderer>.obj


For example:

BepInEx\plugins\CustomMeshes\HelmetPadded\HelmetPadded\default.obj

or

BepInEx\plugins\CustomMeshes\HelmetPadded\attach_skin\ChainLinkVisor.obj



Player Meshes

To import player meshes, you need to create an AssetBundle with a body object in it. Please don't ask me how to do that, I have no clue. You can ask people working on it in my discord server if you know something about Unity.


Step One: create a folder called player with a subfolder called model in the CustomMeshes folder. So now you have:

BepInEx\plugins\CustomMeshes\player\model


Step Two: put the asset bundle you created in the subfolder, naming it 0 for male and 1 for female (make sure it has no file extension).


Installation

To install the mod itself, you can just use Vortex, the Nexus Mods mod manager. It should take care of all dependencies.

To install manually, place the dll file in the BepInEx/plugins folder. You will need BepInEx.

The mod requires two additional dll files to import fbx meshes: assimp.dll and AssimpNet.dll. They are included in the optional files, and I would recommend installing them. I think the mod will work without them, but you won't be able to import fbx files without them. Place assimp.dll in the root Valheim folder beside the exe file and AsimpNet.dll in the BepInEx\plugins folder, same as in the zip file structure.


Credits

Thanks to Ryder for the meshes and testing and general help! Also Sandmouse for taking part in the testing!

This project uses UnityMeshImporter by Dongho Kang, AssimpNet by Nicholas Woodfield, and Open Asset Import Library (Assimp) by Assimp Development Team, all under the MIT license.

This project uses OBJImporter by el anónimo, licensed under CC BY-SA 3.0.


Technical

Code is at https://github.com/aedenthorn/ValheimMods.

If you want to complain or ask for help or help me test my mods, you can visit my Discord server.

Click here for a list of all my mods for Valheim.