2020-07-15 00:16:40 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "MetasoundFrontend.h"
|
2021-01-13 10:48:59 -04:00
|
|
|
#include "MetasoundFrontendDocument.h"
|
2020-07-17 16:43:42 -04:00
|
|
|
#include "MetasoundAssetBase.h"
|
|
|
|
|
|
2020-07-15 00:16:40 -04:00
|
|
|
|
2020-07-15 12:59:38 -04:00
|
|
|
#if WITH_EDITORONLY_DATA
|
|
|
|
|
#include "EdGraph/EdGraph.h"
|
2020-07-30 16:57:04 -04:00
|
|
|
#include "Misc/AssertionMacros.h"
|
2020-07-15 12:59:38 -04:00
|
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
|
|
2020-07-15 00:16:40 -04:00
|
|
|
#include "Metasound.generated.h"
|
|
|
|
|
|
2020-07-23 16:39:56 -04:00
|
|
|
// Forward Declarations
|
|
|
|
|
class FEditPropertyChain;
|
|
|
|
|
struct FPropertyChangedEvent;
|
2020-07-15 00:16:40 -04:00
|
|
|
|
2020-07-22 14:52:03 -04:00
|
|
|
|
2020-07-15 00:16:40 -04:00
|
|
|
/**
|
|
|
|
|
* This asset type is used for Metasound assets that can only be used as nodes in other Metasound graphs.
|
|
|
|
|
* Because of this, they can have any inputs or outputs they need.
|
|
|
|
|
*/
|
2020-07-15 12:59:38 -04:00
|
|
|
UCLASS(hidecategories = object, BlueprintType)
|
2020-07-17 16:43:42 -04:00
|
|
|
class METASOUNDENGINE_API UMetasound : public UObject, public FMetasoundAssetBase
|
2020-07-15 00:16:40 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
protected:
|
2020-08-05 12:47:19 -04:00
|
|
|
UPROPERTY(EditAnywhere, Category = CustomView)
|
2021-01-13 10:48:59 -04:00
|
|
|
FMetasoundFrontendDocument MetasoundDocument;
|
2020-12-14 15:48:27 -04:00
|
|
|
|
|
|
|
|
// Returns document object responsible for serializing asset
|
2021-01-13 10:48:59 -04:00
|
|
|
Metasound::Frontend::TAccessPtr<FMetasoundFrontendDocument> GetDocument() override;
|
2020-12-14 15:48:27 -04:00
|
|
|
|
|
|
|
|
// Returns document object responsible for serializing asset
|
2021-01-13 10:48:59 -04:00
|
|
|
Metasound::Frontend::TAccessPtr<const FMetasoundFrontendDocument> GetDocument() const override;
|
2020-07-15 00:16:40 -04:00
|
|
|
|
2020-07-15 12:59:38 -04:00
|
|
|
#if WITH_EDITORONLY_DATA
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
UEdGraph* Graph;
|
|
|
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
|
|
2020-07-15 00:16:40 -04:00
|
|
|
public:
|
|
|
|
|
UMetasound(const FObjectInitializer& ObjectInitializer);
|
|
|
|
|
|
2020-07-15 12:59:38 -04:00
|
|
|
#if WITH_EDITORONLY_DATA
|
2020-07-30 16:57:04 -04:00
|
|
|
// Returns document name (for editor purposes, and avoids making document public for edit
|
|
|
|
|
// while allowing editor to reference directly)
|
|
|
|
|
static FName GetDocumentPropertyName()
|
|
|
|
|
{
|
2020-12-14 15:48:27 -04:00
|
|
|
return GET_MEMBER_NAME_CHECKED(UMetasound, MetasoundDocument);
|
2020-07-30 16:57:04 -04:00
|
|
|
}
|
2020-07-15 12:59:38 -04:00
|
|
|
|
|
|
|
|
// Returns the graph associated with this Metasound. Graph is required to be referenced on
|
|
|
|
|
// Metasound UObject for editor serialization purposes.
|
|
|
|
|
// @return Editor graph associated with UMetasound.
|
2020-07-23 20:32:26 -04:00
|
|
|
virtual UEdGraph* GetGraph() override;
|
|
|
|
|
virtual const UEdGraph* GetGraph() const override;
|
|
|
|
|
virtual UEdGraph& GetGraphChecked() override;
|
|
|
|
|
virtual const UEdGraph& GetGraphChecked() const override;
|
2020-07-15 12:59:38 -04:00
|
|
|
|
|
|
|
|
// Sets the graph associated with this Metasound. Graph is required to be referenced on
|
|
|
|
|
// Metasound UObject for editor serialization purposes.
|
|
|
|
|
// @param Editor graph associated with UMetasound.
|
2020-07-23 20:32:26 -04:00
|
|
|
virtual void SetGraph(UEdGraph* InGraph) override;
|
2020-07-15 12:59:38 -04:00
|
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
|
|
2021-02-01 15:59:27 -04:00
|
|
|
UObject* GetOwningAsset() override
|
2020-07-23 16:39:56 -04:00
|
|
|
{
|
2021-02-01 15:59:27 -04:00
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const UObject* GetOwningAsset() const override
|
|
|
|
|
{
|
|
|
|
|
return this;
|
2020-07-17 16:43:42 -04:00
|
|
|
}
|
2020-07-15 00:16:40 -04:00
|
|
|
|
2021-01-22 03:05:22 -04:00
|
|
|
const TArray<FMetasoundFrontendArchetype>& GetPreferredMetasoundArchetypes() const override;
|
2020-12-14 15:48:27 -04:00
|
|
|
|
2021-01-22 03:05:22 -04:00
|
|
|
bool IsMetasoundArchetypeSupported(const FMetasoundFrontendArchetype& InArchetype) const override;
|
2020-12-14 15:48:27 -04:00
|
|
|
|
2021-01-22 03:05:22 -04:00
|
|
|
const FMetasoundFrontendArchetype& GetPreferredMetasoundArchetype(const FMetasoundFrontendDocument& InDocument) const override;
|
2020-12-14 15:48:27 -04:00
|
|
|
|
|
|
|
|
};
|