Swapping Actors automatically in the editor

Hi all,

Is it possible to swap Actors in my level automatically in the editor?

My use case: I have placed a bunch of Static Meshes (100s probably), but since then most of these now have some kind of functionality and have Blueprint versions. I was wondering if it would be possible to swap these out without manually going through the entire level. All would have identical positions, rotations and scales etc. Also, if the StaticMesh was called, ‘Door’ the Blueprint asset version will always be in a Subdirectory called, ‘Blueprints’ with a name BP_x (I,e, BP_Door).

Coming from Unity I could just write an Editor script to do this, is there something similar in UE4?

Kind regards in advance,
Matt.

Update: I’ve found a way of doing this by selecting all the actors of a certain type, selecting the new version of the asset in the Content Browser, right clicking on any selected one in the editor, selecting, ‘Replace Selected Actors with’. It’s not an automated solution, but requires far less manual lifting than going around re-positioning everything.

  • Matt.
6 Likes

Hell yeah man. I’ve been trying to find a solution to this forever! You rock!

Wow, that saved me so much time! Thank you! :slight_smile:

I’m also still trying to find a way to do this automatically. In the blueprint editor I can select tags but can’t find a way to select actor names with specific prefixes. If someone knows how to do this with blueprints or also include some C++ if need be please let me know. Thanks!

One solution is to make an Editor Utility Widget to help.

Create one Editor Utility Widget (In the Asset Browser’s Add menu, it has an Editor Utility group), you can add a button and bind your Replace function to it.
Editor Utility class has the built-in node to get all actors of a certain class. So we can add all of Static Mesh actors into an array, then loop through them to decide (use some rules like name prefix) if each should be replaced with another actor, and then move it into a new desired folder if needed.

PS: right-click the Editor Utility Widget to Run it

Hello, does this still work in 5.2? I get an error message like this when I try to “replace selected actors with” in 5.2
image

CAN YOU ADD THE PITCURE SO WE CAN SEE THAKYOU