Assign material to multiple meshes in Content Browser

Well, that’s still something that could save tons of time.

The request ID seems to have been part of the database issue you guys experienced a while ago, it’s now flagged as an Unknown Issue.

Could we have a new issue created so we can vote for it ?

thanks

Agreed- would save a lot of time.

Just thought I’d bring this to attention again. It would be a really handy feature to have the ability to assign materials in the property matrix. In my case the models aren’t assigned the same material in 3ds Max so it’s just as quick to manually assign the same material to all of them in UE4. Sadly still incredibly slow.

So i might have found a temporary solution also.

The issue I had with SkyHigh’s solution was that it worked for replacing references between materials but not between material and instance.

The way i have found that works (and its by no means perfect (EPIC get onto this and solve it) but you select all your meshes with the material you want to change within the content browser (hopefully you’re organised there…) > right click > Asset Actions > Select actors using this asset. That will then select all the meshes within the design space, and you should then be able to change the material in the details window to the right.

If the materials do not show up, you might have selected a mesh(s) that are contained within a group and for some reason you cannot change that… Dont ask me why…

Im just a noob at this but thought i would explain a way i found that it works.

Please return the favour if you find a better / faster way.

Cheers

This is not a proper solution since it only changes the material on instances in the scene outliner and not on your content browser meshes.

1 Like

still no solution…

Bump. Is there some way we can get this added to an official list and vote on it? I’ve been wanting this for more than 2 years now!

1 Like

Bump. Me too!

Bump. Me too

So, you can’t do this in the bulk asset editor, but you CAN do this now with Blutility \o/

  1. Make sure Blutility is enabled under Experimental
  2. In content browser go Add New > Blueprints > Blutility
  3. Make the parent class “AssetActionUtility”
  4. Paste [these nodes][1] in, compile and save.
  5. Now you can select a material, then select any number of static mesh assets, right-click and “Apply Material To Static Mesh”

(This is in 4.20)

3 Likes

To complete Spoondog answer, you could also automate the process using python.

The script presents two ways of applying material: on all static mesh in a directory of the content browser, on static mesh of selected actors in level.

import unreal
new_material_path = '\Game\M_NewMat'
asset_folder = '\Game\Geometries'

load_material = unreal.EditorAssetLibrary.load_asset(new_material_path)
version = 1
#version 1: setting material based on asset in a  content browser directory
if version == 1:
	list_assets = unreal.EditorAssetLibrary.list_assets(asset_folder,True,False)
	for asset in list_assets:
		load_asset = unreal.EditorAssetLibrary.load_asset(asset)
		if load_asset.get_class() == unreal.StaticMesh.static_class():
			load_asset.set_material(0,load_material)
			unreal.EditorAssetLibrary.save_asset(asset)
#version 2: setting material on meshes contained in selected static mesh actors in the level
elif version == 2:
	list_selected_static_mesh_actors = unreal.EditorFilterLibrary.by_class(unreal.EditorLevelLibrary.get_selected_level_actors(),unreal.StaticMeshActor)
	for static_mesh_actor in list_selected_static_mesh_actors:
		static_mesh_component = static_mesh_actor.static_mesh_component
		if static_mesh_component is None:
			continue
		static_mesh = static_mesh_component.static_mesh
		if static_mesh is None:
			continue
		static_mesh.set_material(0,load_material)
		unreal.EditorAssetLibrary.save_asset(static_mesh.get_path_name())

I have this issue on nearly every single task I do, I’m really surprised it wasn’t the first thing to be added into the matrix.

What would be nice is selecting a material in the content browser right clicking and clicking and option that selects meshes with material so you could do a large material replace with some other material. Is this possible with Blutility?

Yea it should be possible in blutility by iterating assets via the asset registry. Or you could maybe do it now by using the reference viewer to find the meshes using the material (I think you can select multiple things in the content browser via the reference viewer), and then apply the new material via the method I posted above.

Would you be able to assemble a node graph and post a photo on here please? I am a noob for sure!

So still not solved?

Count me in! Just imported a bunch of buildings and now going one by one changing the material :frowning:

Both Spoondogs and Flaviens answers give you quick and quite easy to set up ways to batch-apply materials to meshes, especially now with more advanced blutility potions.

I had the same problem many times, so I made a blutility that assigns single material to many meshes.

[EDIT] A newer tool is available: https://youtu.be/pHIAV5Bt-4U

Here’s a free download: BlutilityTools | Unreal Engine 4

Overview and installation video: https://www.youtube.com/watch?v=JShsgf7lcAw

3 Likes

This man is a genius, I know this is 2 years old but I’m so happy I found this.