I know I can just create new material instance and assign it to object, but I’d rather replace existing material straightaway, so the new material instance keeps original name and all objects that were using original material will be using new material instance.
A material instance requires a master material. Think of it as just settings for the real material. In that sense, it can’t replace the master material.
In content browser, I want to replace material with material instance that refers to some other material. Without first creating material instance than manually dragging it to mesh(or meshes) that use original material.
You could create Blutility that performs SetMaterial for all selected objects.
It’s usually easier to set default material of staticMesh and never editing the instances. This way all instances of that assets updates their properties at once.
I wasn’t talking about replacing materials on instances (i.e. objects in the scene). I meant situation when same material in content browser can be used by multiple meshes.
Wouldn’t that cause problems if mesh has more than one material? Unreal engine supports that, and that’s the main reason why I want to replace material with instance instead of manually assigning instance to meshes.
Replace references should not cause any material references to become none, since it should leave behind redirectors that tell any unloaded content where to find the new references. These will show up as 0 or 1k files in the directory of the same name as the replaced assets.
Are you able to reproduce the issue where replacing references causing references to be lost?
No, I’m unable to reproduce the issue. However, I’m fairly certain that 1st time I tried to do that, I had all materials reset to “None” on skeletal model.
First time I did that I was merging automatically generated fbx materials on skeletal mesh into MaterialInstances. When I opened model in mesh editor after that, it had material set to “none” for every element. Said model was displaying fine before that. I also did not have this kind of issue on static meshes or on model that had materials manually reassigned in the past.