FReply FSpriteComponentDetailsCustomization::MergeSprites() { TArray<UObject*> StrongObjects; CopyFromWeakArray(StrongObjects, ObjectsBeingCustomized); FPaperGroupedSpriteUtilities::MergeSprites(StrongObjects); return FReply::Handled(); }
END_SLATE_FUNCTION_BUILD_OPTIMIZATION FReply FBrushDetails::OnCreateStaticMesh() { TArray<AActor*> ValidSelectedBrushes; CopyFromWeakArray(ValidSelectedBrushes, SelectedBrushes); GEditor->ConvertActors(ValidSelectedBrushes, AStaticMeshActor::StaticClass(), TSet<FString>(), true); return FReply::Handled(); }
FReply FGroupedSpriteComponentDetailsCustomization::SortSprites() { TArray<UObject*> StrongObjects; CopyFromWeakArray(StrongObjects, ObjectsBeingCustomized); TArray<UActorComponent*> ComponentList; TArray<AActor*> IgnoredList; FPaperGroupedSpriteUtilities::BuildHarvestList(StrongObjects, UPaperGroupedSpriteComponent::StaticClass(), /*out*/ ComponentList, /*out*/ IgnoredList); const FVector SortAxis = GetDefault<URendererSettings>()->TranslucentSortAxis; const FScopedTransaction Transaction(LOCTEXT("SortSprites", "Sort instances in group")); for (UActorComponent* Component : ComponentList) { UPaperGroupedSpriteComponent* GroupedComponent = CastChecked<UPaperGroupedSpriteComponent>(Component); GroupedComponent->SortInstancesAlongAxis(SortAxis); } GEditor->RedrawLevelEditingViewports(true); return FReply::Handled(); }