Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd/Classes/MaterialGraph/MaterialGraphNode_Base.h
francis hurteau fc0b9c9fa8 Flag Material Graph and Nodes as Optional so that they would also be included in the optional sidecar data alongside material expressions
#rb Jason.Nadro
#preflight 6282cac0734d065770482e21

#ROBOMERGE-AUTHOR: francis.hurteau
#ROBOMERGE-SOURCE: CL 20260724 via CL 20266997 via CL 20267266 via CL 20267382
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20269504 by francis hurteau in ue5-main branch]
2022-05-18 18:05:07 -04:00

74 lines
3.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "EdGraph/EdGraphNode.h"
#include "MaterialGraphNode_Base.generated.h"
class UEdGraphPin;
class UEdGraphSchema;
UCLASS(MinimalAPI, Optional)
class UMaterialGraphNode_Base : public UEdGraphNode
{
GENERATED_UCLASS_BODY()
/** Create all of the input pins required */
virtual void CreateInputPins() {};
/** Create all of the output pins required */
virtual void CreateOutputPins() {};
/** Is this the undeletable root node */
virtual bool IsRootNode() const {return false;}
/** Gets the object that owns this node, typically either a UMaterial, UMaterialFunction, UMaterialExpression */
virtual UObject* GetMaterialNodeOwner() const { return nullptr; }
/** Returns the SourceIndex associated with a particular FMaterialConnectionKey::InputIndex */
virtual int32 GetSourceIndexForInputIndex(int32 InputIndex) const;
/** Get a single Input Pin via its index */
UNREALED_API class UEdGraphPin* GetInputPin(int32 InputIndex) const;
/** Get a single Output Pin via its index */
UNREALED_API class UEdGraphPin* GetOutputPin(int32 OutputIndex) const;
/** Gets the exec input pin */
UNREALED_API class UEdGraphPin* GetExecInputPin() const;
/** Get a single exec Output Pin via its index */
UNREALED_API class UEdGraphPin* GetExecOutputPin(int32 OutputIndex) const;
/** Replace a given node with this one, changing all pin links */
UNREALED_API void ReplaceNode(UMaterialGraphNode_Base* OldNode);
/** Get the Material value type of an input pin */
uint32 GetInputType(const UEdGraphPin* InputPin) const;
/** Get the Material value type of an output pin */
uint32 GetOutputType(const UEdGraphPin* OutputPin) const;
/**
* Handles inserting the node between the FromPin and what the FromPin was original connected to
*
* @param FromPin The pin this node is being spawned from
* @param NewLinkPin The new pin the FromPin will connect to
* @param OutNodeList Any nodes that are modified will get added to this list for notification purposes
*/
void InsertNewNode(UEdGraphPin* FromPin, UEdGraphPin* NewLinkPin, TSet<UEdGraphNode*>& OutNodeList);
//~ Begin UEdGraphNode Interface.
virtual void AllocateDefaultPins() override;
virtual void ReconstructNode() override;
virtual void RemovePinAt(const int32 PinIndex, const EEdGraphPinDirection PinDirection) override;
virtual void AutowireNewNode(UEdGraphPin* FromPin) override;
virtual bool CanCreateUnderSpecifiedSchema(const UEdGraphSchema* Schema) const override;
virtual FString GetDocumentationLink() const override;
virtual void PostPasteNode() override;
//~ End UEdGraphNode Interface.
protected:
void ModifyAndCopyPersistentPinData(UEdGraphPin& TargetPin, const UEdGraphPin& SourcePin) const;
virtual uint32 GetPinMaterialType(const UEdGraphPin* Pin) const;
void EmptyPins();
/** Return the first input pin matching the name */
class UEdGraphPin* GetInputPin(const FName& PinName) const;
};