On demand material remap & multiple selection

Hi.

How do I use on demand material remap with multiple selections?

I have 100s of fbx files that all share the same materials. I really don’t want to do each one individually.

Only work around I have found is a find and replace inside the meta files.

Thanks

Bump because I would really like to know

6296950--696739--upload_2020-9-10_9-25-36.png

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class MaterialLocationAssetPostprocessor : AssetPostprocessor
{
    void OnPreprocessModel()
    {
        var importSettingsMissing = assetImporter.importSettingsMissing;

        if (!importSettingsMissing)
            return; // Asset imported already, do not process.

        var modelImporter = assetImporter as ModelImporter;
        modelImporter.SearchAndRemapMaterials(ModelImporterMaterialName.BasedOnMaterialName, ModelImporterMaterialSearch.Everywhere);
    }
}
1 Like

Hi,
I found a solution for my problem I hope it is applyable to yours as well.
When it is about not seeing textures of fbx files you my try reseting the import by goint to the materials tab clicking on the tree dots and reset.This loaded my embedded textures.

1 Like