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

Be sure to override GetSupportedClass Function to Static Mesh so that the right click scripted action only shows for valid selections in the content browser

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

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

2 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.