A paint library is a file that contains paints and multi-paint setups , which can be referenced by any vehicle. This allows for sharing paints between vehicles of the same brand, sharing generic custom paints, and generally simplifying the process of adding paint color presets to a vehicle. It is loaded before the vehicle is processed, making it available when selecting a vehicle to spawn.
The default paint library file is stored in the file vehicles/common/paintLibraries/common.paintLibrary.json
. However, any modder can create any file with the name ending with .paintLibrary.json
, and it will function the same way as the default one, adding new paints and multi-paint setups available on all vehicles.
The name and/or directory of the user’s custom file must be unique, for example vehicles/common/myModPaints/common.paintLibrary.json
or vehicles/common/paintLibraries/myMod.paintLibrary.json
. It can even be placed inside a custom vehicle folder, and it will still be accessible by all vehicles - all paints from all paint library files, no matter the location, can be accessed from any main info.json
file of any vehicle.
The content of a paint library file looks like this:
{
"version": 1,
"paints": {
"bianco_alpino": {
"name": "Bianco Alpino",
"baseColor": [0.85, 0.88, 0.87, 1.2],
"clearcoat": 0,
"clearcoatRoughness": 0,
"metallic": 0,
"roughness": 0.07
},
"blu_acciaio": {
"name": "Blu Acciaio",
"baseColor": [0.25, 0.3, 0.35, 1.2],
"clearcoat": 0,
"clearcoatRoughness": 0,
"metallic": 0,
"roughness": 0.07
},
(...)
}
},
"multiPaintSetups" : {
"team_offroad_colors" : {
"name": "Orange Race Colors",
"paint1": "signal_orange",
"paint2": "palladium_gray",
"paint3": "black_diamond"
},
(...)
}
}
The paint definition inside of the paint library is almost identical to the standard paint definition. The difference is that the name of the paint is inside the list of the parameters, and the index (shown in the highlighted lines) is the Paint ID instead. This is to make it possible for the paint name to be translated into different languages in the future. The paint name parameter is still used when setting the library paint as default for the vehicle or configuration.
The paint name shows when hovering over the paint with the mouse.
In order to use a library paint on a vehicle, you add a simple section inside its main info.json
file:
"libraryPaints": [
"bianco_alpino",
"blu_costa",
"blu_nebbia",
"arancione",
"blu_marina",
"nero_puro",
"rosso_scarlatto",
{"id": "argento_metallizzato", "class": "custom"},
{"id": "arancio_metallizzato", "class": "custom"},
{"id": "verde_speciale_metallizzato","class": "custom"},
{"id": "bordeaux", "class": "custom"},
{"id": "rosso_fuoco", "class": "custom"},
{"id": "blu_tropicale", "class": "custom"},
{"id": "giallo_solare", "class": "custom"},
{"id": "giallo_savana", "class": "custom"},
{"id": "verde_opale", "class": "custom"},
{"id": "verde_edera", "class": "custom"},
{"id": "carbone", "class": "custom"},
{"id": "blu_brillante", "class": "custom"},
{"id": "azzurro", "class": "custom"},
{"id": "chiaro_di_luna", "class": "custom"}
]
Notice that the section uses square brackets, while the one inside paintLibrary.json
has curly ones.
When adding a paint from the library:
An info.json file using both standard paint definitions and the paint library references will look like this:
{
(...)
"defaultPaintName1": "Rosso Corallo",
"paints": {
"Alabastro": {
"class": "custom",
"baseColor": [0.84, 0.79, 0.76, 1.2],
"clearcoat": 0,
"clearcoatRoughness": 0,
"metallic": 0,
"roughness": 0.07
},
(...)
},
"libraryPaints": [
"bianco_alpino",
(...)
{ "id": "argento_metallizzato", "class": "custom" },
(...)
]
}
Was this article helpful?