User Tools

Site Tools


material-sets

Material Sets

Like the church, a monument can have material sets. This means that each material (base and replacement) must be listed in your monument asset property MaterialSetList.

For each material set, all materials must be listed in the same order as their replacement:

mod:register({
    DataType = "MONUMENT",
    ...
    MaterialSetList = {
        {
            SetName = "DEFAULT",
            MaterialList = {
                "MAIN_MATERIAL",
                "SECONDARY_MATERIAL",
                "TERTIARY_MATERIAL"
            }
        },
        {
            SetName = "ALTERNATIVE",
            MaterialList = {
                "MAIN_MATERIAL_ALT",
                "SECONDARY_MATERIAL_ALT",
                "TERTIARY_MATERIAL_ALT"
            }
        }
    }
})

When you import a FBX file, materials are imported alongside the model. You can find those materials in a virtual directory Materials, inside the FBX file. You can see an example in the Example02 mod, where the materials are in models/MithrilFactory.fbx/Materials.

In this directory, you can find all your materials. You can then register an ID for each of those materials, to use them in the material set list:

mod:registerAssetId("models/YourMonumentModel.fbx/Materials/MainMaterial", "MAIN_MATERIAL")
mod:registerAssetId("models/YourMonumentModel.fbx/Materials/MainMaterialAlt", "MAIN_MATERIAL_ALT")

If a material is not used on the model, it will not be imported. To circumvent this, you can create a dummy object that will not be used in the mod, to apply your material on.

material-sets.txt · Last modified: 2020/04/28 18:36 by maxime