How can I create a "Select Actor" popup

Hi,

I’m trying to create popup, similar to the one where you set a reference for a variable:

I would like to be able to select multiple actors (one is fine too) and get an array of references (or pointers) that I can use later in code.

Can anyone help me with this, or maybe link me a few tutorials that might help? Thanks a lot

Soft Object (Actor) Reference? :thinking:

Can you describe in more detail what/why you need this?

I’m trying to make an editor widget that lets me select actors to export. I don’t want to use File > Export Selected... everytime, so I wrote a simple C++ function that calls the correct function for my use case.

I want a widget to have an intuitive user experience when exporting my actors, instead of selecting them from the level.

In this example widget, I’d like the “Select” button to open the popup and let me chose multiple (one is fine too) actors. I will then call a C++ that takes the array of actors as parameter

You can select the actors you want in the level (in the Outliner) as usual and get a list:

	TArray<AActor*> Actors;
	GEditor->GetSelectedActors()->GetSelectedObjects<AActor>(Actors);

I’m trying to avoid having to select the actors from the outliner. I find it unintuitive and it can become a hassle to select multiple actors far apart from each other in big levels.

I can already select them from C++ this way (once I have a pointer):

// Mark actors as selected
for (AActor* Actor : Actors) {
	GEditor->SelectActor(Actor, true, true);
}

What I’m looking for is how to create the popup window, similar to the screenshot in the original post.

You can make an Actor Action Utility that is launched via the RMB context menu on the actor(s).

Outliner tab solves this.

You can use Single Property View or Details Views (for array) widget.

I’ll look into it, thanks

Edit: SinglePropertyView was close enough to what I had in mind.

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