Download

Add component to many actors at once in editor

I’m looking for a way to add a component to a large number of actors at the same time in the editor. It doesn’t seem to be possible directly in the editor, unless I’m missing something.
I expected to be able to do this with blutilities, but I can’t get a ‘Add Component’ function in my blutility.

If this is not possible, does anyone have any suggestions for how to add custom data/behavior to a large number of actors? I can do it at runtime, but I’d like to be able to set some starting values in the editor. The best workaround I can come up with is using tags in the editor to store starting values, and then read the tags as strings and parse them to actually set values at runtime in my custom component. It works, but is definitely not ideal.

Thanks!

I don’t know what your purpose is but maybe you can add the component manually and then just set static mesh with a variable and/or show/hide the component if they are not in use?

My purpose is to add custom functionality/data to imported geometry. I’m working in arch viz, and the imported geometry can easily have hundreds of separate actors so it is impractical to add components one at a time manually.

what kind of component are you trying to add ;o?
and to which actor?

Have you tried scripting this in python? In that topic there are examples of what can be done:

https://forums.unrealengine.com/deve…cripts-library

And python docs for unreal:

https://docs.unrealengine.com/en-us/Editor/Scripting-and-Automating-the-Editor/Scripting-the-Editor-using-Python

What class are those actors? You mean static meshes?

Thanks for the replies.

I’m using datasmith to import cad geometry, and it comes in as a large hierarchy of both static mesh actors and empty actors. For example, a door might come in as an empty actor with a bunch of wood panel static mesh actors attached to it, and that door actor is in turn attached to an empty actor for the room, which itself has static mesh actors attached to it for the walls. There are easily hundreds of actors in all.

I’m trying to add a custom blueprint component that I made myself. As just one example, I’m thinking of an ‘exploding’ feature that expands an imported hierarchy, but I want more detailed control over the expansion like some parts expand in the x direction, some in the y, some expand twice as far as other, etc. I don’t know in advance exactly what I want each part to do, so I’d like a way to easily iterate and test. In an ideal world I would simply select all of the actors in the scene, add my custom ‘expand’ component to all of them, and then it would be quick and easy for me to adjust values and test different expansion configurations. That of course is just one example, but in general I’m looking for a way to add custom behavior to a large number of actors in the editor.

My understanding for python was that everything exposed to python was automatically exposed to blutilities as well, and since I can’t find a way to add a component through a blutility I figured it wouldn’t work in python either. But certainly worth taking a look in case I’m wrong!