2021-11-07 23:43:01 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Engine/Engine.h"
|
2022-10-13 17:38:11 -04:00
|
|
|
#include "Engine/StreamableManager.h"
|
2021-11-07 23:43:01 -05:00
|
|
|
#include "MetasoundAssetBase.h"
|
|
|
|
|
#include "MetasoundAssetManager.h"
|
2024-05-08 14:53:53 -04:00
|
|
|
#include "MetasoundBuilderBase.h"
|
2021-11-07 23:43:01 -05:00
|
|
|
#include "Subsystems/EngineSubsystem.h"
|
|
|
|
|
#include "UObject/Object.h"
|
|
|
|
|
|
|
|
|
|
#include "MetasoundAssetSubsystem.generated.h"
|
|
|
|
|
|
|
|
|
|
// Forward Declarations
|
|
|
|
|
class UAssetManager;
|
|
|
|
|
class FMetasoundAssetBase;
|
|
|
|
|
|
2021-11-18 14:37:34 -05:00
|
|
|
struct FDirectoryPath;
|
2024-01-31 17:59:29 -05:00
|
|
|
struct FMetaSoundFrontendDocumentBuilder;
|
2021-11-18 14:37:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
USTRUCT(BlueprintType)
|
|
|
|
|
struct METASOUNDENGINE_API FMetaSoundAssetDirectory
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Directories, meta = (RelativePath, LongPackageName))
|
|
|
|
|
FDirectoryPath Directory;
|
|
|
|
|
};
|
2021-11-07 23:43:01 -05:00
|
|
|
|
2022-10-13 17:38:11 -04:00
|
|
|
/** Contains info of assets which are currently async loading. */
|
|
|
|
|
USTRUCT()
|
|
|
|
|
struct FMetaSoundAsyncAssetDependencies
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
// ID of the async load
|
|
|
|
|
int32 LoadID = 0;
|
|
|
|
|
|
|
|
|
|
// Parent MetaSound
|
|
|
|
|
UPROPERTY(Transient)
|
|
|
|
|
TObjectPtr<UObject> MetaSound;
|
|
|
|
|
|
|
|
|
|
// Dependencies of parent MetaSound
|
|
|
|
|
TArray<FSoftObjectPath> Dependencies;
|
|
|
|
|
|
|
|
|
|
// Handle to in-flight streaming request
|
|
|
|
|
TSharedPtr<FStreamableHandle> StreamableHandle;
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
namespace Metasound::Engine
|
|
|
|
|
{
|
|
|
|
|
void DeinitializeAssetManager();
|
|
|
|
|
void InitializeAssetManager();
|
|
|
|
|
} // namespace Metasound::Engine
|
|
|
|
|
|
|
|
|
|
/** DEPRECATED: Subsystem in charge of the MetaSound asset registry */
|
2021-11-07 23:43:01 -05:00
|
|
|
UCLASS()
|
2024-05-08 14:53:53 -04:00
|
|
|
class METASOUNDENGINE_API UMetaSoundAssetSubsystem : public UEngineSubsystem
|
2021-11-07 23:43:01 -05:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
2022-10-13 17:38:11 -04:00
|
|
|
using FAssetInfo = Metasound::Frontend::IMetaSoundAssetManager::FAssetInfo;
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
virtual void Initialize(FSubsystemCollectionBase& InCollection) override;
|
|
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual void RemoveAsset(const UObject& InObject);
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual void RemoveAsset(const FAssetData& InAssetData);
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual void RenameAsset(const FAssetData& InAssetData, bool bInReregisterWithFrontend = true);
|
2021-11-07 23:43:01 -05:00
|
|
|
|
2022-10-13 17:38:11 -04:00
|
|
|
#if WITH_EDITORONLY_DATA
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual void AddAssetReferences(FMetasoundAssetBase& InAssetBase);
|
2022-10-13 17:38:11 -04:00
|
|
|
#endif
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
Metasound::Frontend::FNodeRegistryKey AddOrUpdateAsset(const FAssetData& InAssetData);
|
2024-01-31 17:59:29 -05:00
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual Metasound::Frontend::FNodeRegistryKey AddOrUpdateAsset(const UObject& InObject);
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual bool CanAutoUpdate(const FMetasoundFrontendClassName& InClassName) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual bool ContainsKey(const Metasound::Frontend::FNodeRegistryKey& InRegistryKey) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual const FSoftObjectPath* FindObjectPathFromKey(const Metasound::Frontend::FNodeRegistryKey& RegistryKey) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual FMetasoundAssetBase* GetAsAsset(UObject& InObject) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual const FMetasoundAssetBase* GetAsAsset(const UObject& InObject) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Implementation of MetaSound asset management has been moved to raw c++ implementation for more reliable, monolithic "
|
|
|
|
|
"lifetime management. This subsystem continues to exist only for Blueprint-related asset functionality. "
|
|
|
|
|
"Use IMetaSoundAssetManager::GetChecked() instead")
|
|
|
|
|
static UMetaSoundAssetSubsystem& GetChecked();
|
2024-01-31 17:59:29 -05:00
|
|
|
|
2022-10-13 17:38:11 -04:00
|
|
|
#if WITH_EDITOR
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual TSet<FAssetInfo> GetReferencedAssetClasses(const FMetasoundAssetBase& InAssetBase) const;
|
2022-10-13 17:38:11 -04:00
|
|
|
#endif
|
2024-05-08 14:53:53 -04:00
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual FMetasoundAssetBase* TryLoadAsset(const FSoftObjectPath& InObjectPath) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual FMetasoundAssetBase* TryLoadAssetFromKey(const Metasound::Frontend::FNodeRegistryKey& RegistryKey) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual bool TryLoadReferencedAssets(const FMetasoundAssetBase& InAssetBase, TArray<FMetasoundAssetBase*>& OutReferencedAssets) const;
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual void RequestAsyncLoadReferencedAssets(FMetasoundAssetBase& InAssetBase) { }
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
virtual void WaitUntilAsyncLoadReferencedAssetsComplete(FMetasoundAssetBase& InAssetBase) { }
|
2021-11-07 23:43:01 -05:00
|
|
|
|
2021-11-18 14:37:34 -05:00
|
|
|
UFUNCTION(BlueprintCallable, Category = "MetaSounds|Registration")
|
|
|
|
|
void RegisterAssetClassesInDirectories(const TArray<FMetaSoundAssetDirectory>& Directories);
|
|
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MetaSounds|Registration")
|
|
|
|
|
void UnregisterAssetClassesInDirectories(const TArray<FMetaSoundAssetDirectory>& Directories);
|
|
|
|
|
|
2021-11-07 23:43:01 -05:00
|
|
|
protected:
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to private implementation")
|
|
|
|
|
void PostEngineInit() { }
|
2022-10-13 17:38:11 -04:00
|
|
|
|
2024-05-08 14:53:53 -04:00
|
|
|
UE_DEPRECATED(5.5, "Moved to private implementation")
|
|
|
|
|
void PostInitAssetScan() { }
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
void RebuildDenyListCache(const UAssetManager& InAssetManager) { }
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Use FMetaSoundDocumentBuilder::SetDisplayName instead (call now only available with editor compiled)")
|
|
|
|
|
void ResetAssetClassDisplayName(const FAssetData& InAssetData) { }
|
|
|
|
|
|
|
|
|
|
UE_DEPRECATED(5.5, "Moved to internal implementation, use IMetaSoundAssetManager::GetChecked() and analogous call")
|
|
|
|
|
void SearchAndIterateDirectoryAssets(const TArray<FDirectoryPath>& InDirectories, TFunctionRef<void(const FAssetData&)> InFunction) { }
|
2021-11-07 23:43:01 -05:00
|
|
|
|
|
|
|
|
private:
|
2024-05-08 14:53:53 -04:00
|
|
|
void PostEngineInitInternal();
|
|
|
|
|
void PostInitAssetScanInternal();
|
2021-11-07 23:43:01 -05:00
|
|
|
};
|