/archive/3_post

Permalink : www/retr0_dev/posts/3_post.html

Post date : Wed Feb 16 2022 1310

"Mesh swapping in AE"




What we are going to do, is edit base gamefile meshes of the crowbar, to turn it into a really cool cube.

This tutorial can also be applied for other meshes/models/bundles, it is not limited to the crowbar.

You may not be able to export a mesh file, sometimes you may get lucky and be able to extract LOD1 but not LOD0 for example. At the very least, try and find a mesh file you can export so that you know the scale and orientation. (Maybe you can't export the crowbar, so try exporting another melee weapon such as the knife and use the knife as the base; but just replace the crowbar in stead. The method is the same.

Trial and error! You won't get it perfect every time. Also, edit the mesh directly as edits to the object will not reflect in the export. E.G If you want to scale it down, go into edit mode and change the scale in there. Same goes for rotation.

Requirements :

How to start?

First step: Finding the weapon textures bundle files.


For this, go in your gamedir GameDir\EscapeFromTarkov_Data\StreamingAssets\Windows\assets\content\weapons\crowbar\ and copy the file client_assets.bundle to a backup folder inside the same folder. Then make a folder wherever you want and copy paste the same file in there too for ease of use.

Step two : Extracting the desired texture file.


For this step, we will use AssetBundleExtractor. Open AssetBundleExtractor.exe where you extracted it, you should have this window open after Click on File -> Open and select client_assets.bundle in your folder and click "open".

426ec21de2f806fa4b9ecea86b2c7d66-Full.webp



4724cbf7edf33486d13c7ddd15d7aae7-Full.webp



82d797e4ffab7049f3aa04a89bc11228-Full.webp



Click on "yes" and name the file to save like you want. I will call it extracted and save. After doing this, click on the "Info" box on the main window.



7aff0e49d69af8c38e2cd2f46bbb15a4-Full.webp



362fcbe503c127b6411c95705e46e58e-Full.webp



and this window will pop up on the screen:

5bfa9a77ea72bdafe45f95f7b9f65c5f-Full.webp

Find the mesh file located within and click 'Plugins', then export as dae. (Some models can't be exported yet with current version of exporter. But you can still try! Just skip the export step and import your model into blender.)

4fa28aa8db445b013a8b654cd59d8f8c-Full.webp

Save it within the project folder that you've made, and then open it in blender.

Step three: Edit the mesh file to the new mesh.


What you're going to want to do is import the model you've got made and overlay it over the model.

0a6cc3eabd6f77605c057d1a02072fd0-Preview.webp

Change the material name of the model to m0mat.

0d371459d6e1d684e48582c2692406ca-Full.webp

Then export as .dae

321b7b2cd20751af656d8219e7c1989c-Full.webp

Step four: Using unity to create the bundled mesh.


Load up unity and create a new project.

d6d7781646fba46fcd07321875dd21ff-Full.webp

Name it whatever you want.

927645e3d3043d8bfe17432289a8d3be-Full.webp

Import new asset. (The .dae you exported.)

b4f013a38837f5d2c83782e0f967fec1-Full.webp

dc3dbd9537c9ae6ed77324d6f3500cf9-Full.webp

Drag and drop the new model asset into the main window.

91d0a342328cc965b02ea9aa1f8b27ca-Full.webp



998622d155dc2339eee03f0c6c7e5fe8-Preview.webp

Set the transforms and rotations to 0.

9d240bed4d8d06d0d6c1a269e338b839-Full.webp

Now go to build settings.

5b2ce1e16d6f9d4f1f72c8a9d6cc2525-Full.webp

Click 'Add open scenes'. If it asks for a save file name, call it whatever you want.

19a316552242641eeb48bed15a146ea8-Full.webp



And then click 'Build', save it to your project folder and let it run.

Step five: Opening your newly made bundle and exporting the raw mesh files.


Now we have to use the Unity Asset Bundle Extractor all over again, except this time it's to export the raw mesh files from the bundle you just created. It's pretty much the exact same steps. Navigate to your project folder and open up 'bestmodelever_Data' or w/e you called the project.

35c2faad0aea19cf3e92830ccddaf1a5-Full.webp

Do the same as you did before, open the sharedassets0.assets file.

7419fcb30a54fce8a19591a4ca9198cb-Full.webp

ccec2977356521ac356020797e49056f-Full.webp

And click 'Yes', name the unpacked file whatever you want, then click 'Info' again.
You should see the bundled mesh in here, mine is called 'cube' but it should be called whatever the name of the mesh was inside of blender before you exported it.

c854ac4101df63186d64a12dedf3e667-Full.webp

You want to click 'Export Raw' and save the file with the name of the LOD0, which in this case is weapon_gf_crowbar_LOD0
Then do the same with 'Export Dump' and save that file too with the same name until you have the two files located below.

288b14249e4ae00dd858c53630f9f706-Full.webp

Then open up the text file.

a74f8d677e625ab332556707d832454f-Full.webp

You'll notice the string m_Name is the same as the mesh file in blender. You could set this up ahead of time by renaming it to weapon_gf_crowbar_LOD0 in blender, but you can do it here too. (It's useful for replacing LOD1's as well, without having to re-export a whole new model bundle with that name; etc.)

5679a4a5579b82404972a7b528a10ea8-Full.webp

Step six: Replacing the mesh with our newly acquired exported mesh files!


Open up another window of the unity extractor, go back to the crowbar unity asset bundle again and go through the same process until you're back at the info screen.

1f9c2068a36a3540da27732d4338073d-Full.webp

Click 'Import Raw' and then import the weapon_gf_crowbar_LOD0.dat file.
Then, click 'Import Dump' and then import the weapon_gf_crowbar_LOD0.txt file. (This makes sure it has the correct information/naming in the mesh data.)

129bafe8aff48f5a59148c061747f8b8-Full.webp

And then click 'ok' at the bottom and click 'yes' to save changes.

da997372da778ab106e07273290551ac-Full.webp

Then go to 'File' and 'Save'. Save the file as client_assets.bundle to your project folder.

a41d923a10b1845f55e17cbdb43676ea-Full.webp

0d668b492ecbd807016733eb7972a29a-Full.webp

Once it's saved, simply replace the client_assets.bundle in your crowbar bundles folder with the one in your project folder.

ce339baa49714b816bd2fb6e5733f385-Full.webp

Step seven Launch the game!

Now that every step of this tutorial is done, you can essentially start the game, and see the new mesh in game. (Though it'll be using the original textures, unless you replace those too.)
Follow the tutorial for texture replacement in the same fashion as you do normally.