Easy way to replace all references of a material?

So, since 4.11 i can no longer run my project in debugGame through visual studio because “WorldGridMaterial contains editor only data”, the problem there is, over 300 assets reference that material apparently including default content from the engine.

Is there an easy fix to this?

1 Like

Delete the Material, you should be asked if you want to replace references, just point to your new material.

Obviously backup your projects beforehand

1 Like

Might not be exactly what you’re looking for, but if you just want to change materials on a bunch of brushes at the same time:

SHIFT + S to select all surfaces (or Right Click > Select > Select all Surfaces), and then apply the material you want.

You could also select the brushes you want, then press SHIFT + B to select all surfaces on those brushes, and then apply the material.

1 Like

The problem for me is that when I try to replace the materials and I write the name of the material I want to replace, the filter doesn’t find it, It happens randomly with many materials. but they are all in the same folder, so it doesn’t make any sense

1 Like

Daniel,

If you haven’t already had your question answered, make sure that you create a material instance for the material you want to replace with.

I was having the same problem and this worked it out for me.

2 Likes

Finding this thread years later. Replying in case someone else, like me, is trying to figure this one out.

It looks like you can’t use the Delete Asset interface’s “Replace References” feature to replace a Material with a Material Instance. You can only select Materials. Likely it is the same in reverse; you can’t use it to replace a Material Instance with a Material.

I haven’t found a better method yet than manually replacing each Material with it’s correct Material Instance. It’s awful.

2 Likes

This can get really cumbersome, especially when replacing the Materials from Asset packs with a custom master material.
I wish we’d have a way around this.

Maybe with an utility widget? Im not versed in them, but Im trying somethings out…it could work…maybe. If I manage something Ill post it here

Guys, I think I found a good workaround to this problem thanks to chatGPT :slight_smile:

In short, use Property Matrix for bulk replacing the material with material instance.

Here are the steps in detail (I use UE 5.3.2):

  1. Right click to your “Material” > Asset Actions > Select Actors Using This Asset (This will select all the actors/objects using this Material)
  2. Right click to one of your selected objects > Edit Selection in Property Matrix (You may want to select “Edit Components in the Property Matrix” if you used “Import Into Level” feature)
  3. Select all objects at the “Property Matrix Editor” window and go to “Details” tab. Then click to “Display # Materials” under Materials section (If you have more than one element, click display for all of them).
  4. From the Content Browser, drag and drop your “Material Instance” to the Material you want to replace at the Property Matrix Editor.
  5. Click “Save this asset” at top left of Property Matrix Editor (This might take a while depending on your object amount).

That’s it! You can now delete the Material if you want.
I hope this works out for your case as well. Good luck!

image

1 Like

I believe this method may only work if you are trying to replace in-level material references. In my case, I desired to change the material assignment at a project level.