thumbnail blueprint
blueprint

BPU - Apply new material to static mesh asset selection in Content Browser for all valid material elements

  • Exposure: public
  • UE Version: 5.0

avatar author

RonanMahonArt

January 16, 2023, 3:20 pm

A Blueprint Utility Action which gets the current selection of static meshes and applies a new material to all valid material elements/ID's

Requires Unreal's Editor Scripting Utilities to be enabled in Plugins

First you need to make sure you are creating a blueprint with the correct parent class. Right click on an empty space in the Content Browser> Editor Utilities> Editor Utility Blueprint> Asset Action Utility

Next make a new function (on the leftwith the + button) and now paste the graph above into it. Plug the wire from the NewMaterial into the Function node and it will automatically an input on that function. This allows you to choose what material is applied wach time the script is run. Make sure to change the Class Default (at the top) to include StaticMesh as supported class (over on the right.

Finally when you click on your new function on the left of your blueprint window, enable Call in Editor (over on the right properties overlay). The script will now show up when you right click on any static mesh in the content browser, under Scripted Asset Actions.

Click the button above, it will automatically copy blueprint in your clipboard. Then in Unreal Engine blueprint editor, paste it with ctrl + v
Versions
January 17, 2023
  1. minor bug fix for undo transaction

  2. Used static mesh editor subsystem to get number of valid elements on static mesh

January 16, 2023
  1. First commit

    See

3 comments

  • mkp81

    July 18, 2023, 5:40 pm

    Hey Ronan, thank you for the blueprint! This is exactly what I am looking for. Unfortunately I can’t get it to run as after I am pasting the code the first node doesn’t come with it. It is just not appearing. And I get an error message that „one or more nodes could not be copied". I am on 5.2, creating an editor utility blueprint for assets. Any ideas? Thank you.

  • thhm

    December 1, 2023, 7:55 am

    Hi,

    Also getting the same error "one or more nodes could not be copied". I'm pretty sure im not doing this correctly. :(

    I'm new to editor scripting.. is there a nice tutorial on the basics?

    I really want to get this script to work, would same so much time for me! Thanks

    Edit: ok i figured it out somehow and got it to work, just need know how to do the "override GetSupportedClass Function" part.

    Edit2: seems GetSupportedClass is now depracated in 5.2, we can do the same effect using Class Defaults, adding an entry in Supported Classes for Static Mesh.

  • avatar author

    RonanMahonArt

    May 22, 2025, 1:43 pm

    First you need to make sure you have the correct parent class - right click> Editor Utilities> Editor Utility Blueprint> Asset Action Utility

    Next make a new funtion (on the left) and now paste the graph above into it. Make sure to change the class default (at the top) to include StaticMesh as supported class (over on the right.

    Finally when you click on your new function on the left of your blueprint window, enable Call in Editor (over on the right properties overlay). The script will now show up when you right click on any static mesh in the content browser, under Scripted Asset Actions.