Selecting a specific group of actors to create dynamic matierials for

Hello, im working on a project where I need to apply a new material to 200 actors during a showreel to show the Rebar inside the structure. But there I have well over 200 actors that needs to fade, and this is quite a dilemma for me.

On other projects i’ve had 5 or 6 actors at most and have simply made a duplicate dynamic material BP for each as shown here.

Now with 200 actors i’m not sure what to do, I cant simply “get all actors” without also selecting the 1000 different rebars. Any suggestions ? =l

Give actors tags and get them by Tag or use inheritance and get them by class. Do tell if you need an example.

Hello, thankyou for the reply. An example would be most welcome :slight_smile:

I mean, the system is pretty straightforward:

You can give actors one or more tags:

292773-annotation-2019-11-21-123848.png

And find them like so:

Thankyou, I’ve given them all a tag now. What is the cast node ? do I need to implement that into the formula I had before ?

What is the cast node ?

https://docs.unrealengine.com/en-US/Engine/Blueprints/UserGuide/CastNodes/index.html

If you need access to the actors’ specific components, then yes, you’d have to use it.

hmm, so which actor do I cast to ? can I cast to any of the 200-300 actors ?

Yes, if they’re of the same class.

well, this didnt work

Well, you’re casting to a Static Mesh Actor - are your objects called Static Mesh Actor, I doubt that. Your casts fail. How is your actor called in the Content Browser?


Besides that, I believe the whole approach is very incorrect. I’d do it differently altogether, at the very least I’d implement some functionality inside the actor:

  • each actor creates their own Material Instance Dynamic (MID)
  • Apply_MID_Changes event allows you to manipulate the MID from outside so there’s less spaghetti code everywhere
  • MaterialToggle can flip flop between the original material (Base) and the MID

And the level blueprint:

Have an event that allows you to fetch what you need by Tag. Keep the results in an array of the correct type so only a single cast is necessary. Run the loop after timeline so you use a single timeline for everything and use the object’s event defined earlier.

Image from Gyazo


There are much better approaches to this, though - there is [Material Parameter Collections][3] but see if you can implement this at least. It’s pretty scalable and reusable. You can use it for 4 or 4000 actors.

edit: also, consider looking into inheritance, this will allow you to work with many different objects that share some common functionality (like changing textures).

Good luck!

Thankyou sp much for the reply. I will try and implement this as best as I can :slight_smile:

I dont understand where the “my actors with tag” node comes from ? what would be its name on my end ? where do I find it ?

It’s an array variable you create yourself, it has to be the type of your objects. It acts as a temporary reference container.

Consider investing some time into learning the basics, either YT or just reading the docs; otherwise you might end up pulling your hair every 10 mins or so :frowning:

On the other hand, just getting the hands-on works for some quite well!

thankyou. About creating functionality within each actor. That wont be possible. The models are implemented from IFC, so I havent made these and cant duplicate them. And I dont have tiem to go through every single actor and create functionality, I need a more streamlined method. It also need to happen automatic, this is just a showreel, it wont simulate a game.

Don’t know what IFC is.

I need a more streamlined method

Huh, this IS the streamlined method. It’s 20 or so nodes doing all the work you need.

If you need automation, you need to put in the work upfront. You create a framework first and base the rest of your work on that, otherwise you face a lot of manual labour.

Perhaps you can experiment with re-parenting. Not sure if that’d work for you.


So, in your content browser you have 100s of different actors (?!), each of different class? That’s a pretty horrible way of exporting things. I’d rather have a DataTable of just static meshes and build actors on that.

Look into Material Parameter Collection then - the link is in one of the comments. It does not deal with objects but with materials - imagine having a global material parameter you can control. Any object with that material applied will react to it.

correct, I get 100s of different actors, and each of them has a static mesh thats inherited from them. This is what I get when I import with Datasmith. So im kinda stuck

Never worked with datasmith but the documentation seems fleshed out nicely. Perhaps there are ways of handling it or it can all be set up differently. I’m gonna tap out on that, though.

I still think MPC would work here - see my last comment.

Good luck.

Thanks for all the help, I might try asking on reddit if anyone has any ideas, because I have no idea where to go next.