// Copyright Epic Games, Inc. All Rights Reserved. #include "pch.h" #include "ScenesManager.h" #include "DatasmithUtils.h" static FString ExportPath = TEXT("Export"); const FString& GetExportPath() { return ExportPath; } void SetExportPath(const FString& Path) { ExportPath = Path; } void SetupSharedSceneProperties(TSharedRef DatasmithScene) { DatasmithScene->SetVendor(TEXT("Epic")); DatasmithScene->SetProductName(TEXT("DatasmithSDK")); DatasmithScene->SetProductVersion(*FDatasmithUtils::GetEnterpriseVersionAsString()); DatasmithScene->SetHost(TEXT("DatasmithSDKSample")); } TArray>& GetRegisteredScenes() { static TArray> RegisteredScenes; return RegisteredScenes; } void FScenesManager::Register(TSharedPtr SampleScene) { GetRegisteredScenes().Add(SampleScene); GetRegisteredScenes().StableSort([](auto&& L, auto&& R){ return L->GetName() < R->GetName();}); } const TArray>& FScenesManager::GetAllScenes() { return GetRegisteredScenes(); } TSharedPtr FScenesManager::GetScene(const FString& Name) { int32 Index = 0; for (const TSharedPtr& Scene : GetRegisteredScenes()) { if (Scene->GetName() == Name || FString::FromInt(Index) == Name) { return Scene; } Index++; } return nullptr; }