Blueprint to list all materials without instances

Hi, I’m trying to create a editor blueprint script that can list all materials without materials instances.
Aka, it would look either by selection or automatically for all materials and see if an instances was made with it and would print a message with the path location and material name that has no material instances.
Thank you for your help.

this example prints all NON material instances in the scene from all STATIC MESHES
of the actors in the scene.

  1. Get all actors of class ACTOR
  2. Iterate results from each actor and get all components by class Static mesh
  3. iterate components results and get materials
  4. iterate materials and cast each with MAterial Instance

if cast FAILS then is not and instanced material so you can ADD UNIQUE
to some materials array (you must cast the material before being able to store in the array.

  1. when everything finishes you can iterate the array of materials found and print.

This approach will only give you results from Static Meshes.

You can do the same function replacing static mesh with other
components that can include materials such as Skeletal Meshes, Paper Sprites,
flipbooks.

Hope it helps.
Dany

1 Like

Hi thanks for your reply and for your explanation and screenshots.
I’m very new to those blueprint system.
I have attempted to recreate what you did but unlike you, I have this weird World Context object blue pin under the Get All Actors of class node.
It will refuse to compile if I don’t plug something into that node.

Finally, might sound silly but how do you trigger it? Does it run like an editor script or differently?

Thank you again for your time and help.

I’ve tried to add a “self” node or an “unreal editor subsystem” node.

I do get also in the logs this message:
LogScript: Warning: Script Msg: A null object was passed as a world context object to UEngine::GetWorldFromContextObject().
LogScript: Warning: Script Msg called by: AssetActionUtility_C /Engine/Transient.AssetActionUtility_C_73

ummmn…you re using asset utility…didnt tried it…let me look at this.

1 Like

Sorry forgot to specify that. I can try to create this one in a normal blueprint which type of class of blueprint did you use for that?

Thanks again

I am trying some basic stuff like getting the actors ammount in the scene
by pressing a button and it works…no need to put context.

image
image

you can just try it on the level blueprint.

I just noticed Blueprint Widget utilities are very buggy on UE5.

1 Like

Thank you for your kind help and your time.
The widget approach was the right solution for that.
I got a bit stubborn and obsess with the editor utility blueprint for some reasons.
Full tunnel vision and nothing worked. With further research might come to a solution but that was too much effort for something easier.

I wish you a great day and thanks again for all the helped provided.

1 Like

Have a great day too! :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.