Fix Improper Interior Bounds
Last updated
Last updated
Author: spirit
Since making a custom car involves changing the size, shape and location of the interior you will need to adjust these parts to fit your new vehicle to avoid issues like these:
The interior and exterior bounds are controlled in two places:
Cutout mesh in the .app
file
Lightchannel component in the .ent
file
An alternative approoach can be found in .
Text Editor (preferrably with json highlighting)
Note that the version stated isn't necessarily the lowest required but the one that it's tested on.
First you want to duplicate all your exterior meshes, making sure that they are correctly positioned with the adjusted body position of your car. Now you need to join them into one mesh, and scale that to be slightly smaller e.g. 0.99
making sure that you cannot see the scaled mesh clipping through the interior or exterior pieces. It's also important that your mesh has an underbody.
Joining meshes in blender is done via `Ctrl J` while having multiple meshes selected and the cursor in the viewport.
At this point your project should look something like this, with everything being one mesh, without the interior:
Now you need to remove the parts that don't have an interior e.g. in this case the engine bay and mirrors. For this you will need to select the lasso selection tool (they can be cycled through using W
by default). Enter edit mode by pressing Tab
, turn on Xray mode (in the top right corner)
Then select and delete the area by pressing X > Verticies
Your selection could look similar to this.
With all the unnecessary pieces removed it will look similar to this:
Now it's time to apply the remesh modifier to simplify the mesh.
You need to select smooth and play around with the Octree Depth
while making sure there is only minimal clipping with the interior and exterior.
The result should be similar to this:
Apply the modifier
and add the decimate modifier under Add Modifier > Generate > Decimate
There you move the Ratio
modifier way down until you are in the low hundreds of vertices instead of thousands, also make sure that you enable Trianglulate
. Now apply the modifier and adjust the vertices so there is no clipping apart from on the interior of the windows.
To enable statistics and face orientation see the image below
Your mesh should be blue on the exterior and red on the interior when the face orientation is being displayed. If some triagnles are not, you can select and flip them with Alt F > Flip
At this point your mesh will look like this:
You can export this mesh like you would any other car part (as a static prop).
After importing the mesh into Wolvenkit you need to convert both the .app
and the .ent
file into json format. This is done by right clicking and selecting Convert to Json
. They will now be in the raw
folder of the project. Open the .app.json
with a text editor that supports search and replace and search for the base cutout mesh by typing in e.g. cutout
.
In most applications `Ctrl F` is the shortcut for searching.
Once you have found an instance of the entire path you need to replace all of them with the path to the newly created cutout mesh while making sure to escape \
properly by doubling them.
For example: Replace base\\vehicles\\standard\\v_standard2_villefort_cortes\\entities\\meshes\\cortes_fx_cutout.mesh
with spirit\\bentley_cont_gts\\meshes\\interior\\cutout.mesh
Save the json and convert it back into the .app
file format.
In the .ent.json
you want to search for lightchannel
and find the one that lists vertices and indices. These you will need to copy from the json file we generated earlier while making sure to keep the syntax of the original file (e.g. keeping the commas in the same places etc.)
If you are using a text editor that doesn't support json highlighting you can run the json file through an online validator to ensure that it is correctly formatted.
Save and convert this file back to the .ent
file format.
Now you can install and test the changes.
Before switching to Wolvenkit you need to generate a json file with the verticies and indices (triangles) of the mesh as the lightchannel component doesn't link to a mesh file. For that you need to switch to the Scripting
layout at the top and run (the same script the other guide uses).