x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Is GEditor->GetSelectedActors() Broken?

Heya I'm having a problem with detecting the class of selected actors.

I have a button in my editor plugin which requires two or more actors of the same class to have been selected. But at the moment when I check the classes of two actors, GetSelectedActors() is actually picking a different object in the scene?!

alt text

See this video, where I am selecting each actor in turn, and their class is reported correctly. But as soon as I ctrl-click to multi select them both, GetSelectedActors has picked a totally different object. https://youtu.be/T5VooYWZfqA

I am simply iterating over the selected actors with:

 USelection* actors = GEditor->GetSelectedActors();
 for (uint16 i = 0; i < actors->Num(); i++) {
     UE_LOG(VASFVLog, Warning, TEXT("FVASFVPluginEdModeToolkit::OnlyVolumesSelected Selected Class: %s"), *actors->GetSelectedClass(i)->GetDescription());
 }

Which gets called whenever the button is clicked (seen in the video)

Product Version: UE 4.10
Tags:
more ▼

asked Jul 15 '16 at 06:43 PM in C++ Programming

avatar image

Jayae
57 13 18 25

avatar image Jayae Jul 18 '16 at 09:46 AM

This happens whether I ctrl-click on the second actor in the viewport, or in the world outliner.

avatar image Jayae Jul 20 '16 at 06:42 PM

Can anyone reproduce this as well?

avatar image Jayae Aug 01 '16 at 11:16 AM

Still having this issue.

I'm trying to use it so that I can have a function returning True if two or more actors of the same class have been selected in the editor.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Found that actors->GetSelectedObject(i) does point to the correct UObject, so I guess it's only a problem with GetSelectedClass

I'm able to continue my checking therefore with actors->GetSelectedObject(i)->IsA(AVASFVVolume::StaticClass()) in case anyone else gets this problem in the future.

more ▼

answered Aug 01 '16 at 06:02 PM

avatar image

Jayae
57 13 18 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question