| 578 | } // namespace |
| 579 | |
| 580 | bool DestroyActorSync(const FString& ActorIdOrActorName, FString& OutError) |
| 581 | { |
| 582 | OutError.Empty(); |
| 583 | if (!GEditor) |
| 584 | { |
| 585 | OutError = TEXT("GEditor null"); |
| 586 | return false; |
| 587 | } |
| 588 | UWorld* World = GEditor->GetEditorWorldContext().World(); |
| 589 | if (!World) |
| 590 | { |
| 591 | OutError = TEXT("editor world unavailable"); |
| 592 | return false; |
| 593 | } |
| 594 | |
| 595 | AActor* Found = FindByActorIdOrName(World, ActorIdOrActorName); |
| 596 | if (!Found) |
| 597 | { |
| 598 | OutError = FString::Printf(TEXT("no actor matching '%s'"), |
| 599 | *ActorIdOrActorName); |
| 600 | return false; |
| 601 | } |
| 602 | World->DestroyActor(Found); |
| 603 | return true; |
| 604 | } |
| 605 | |
| 606 | bool SetActorTransformSync( |
| 607 | const FString& ActorIdOrActorName, |