Files
UnrealEngineUWP/Engine/Source/Developer/RigVMDeveloper/Public/RigVMModel/Nodes/RigVMUnitNode.h
Helge Mathee 8dd8ae98d3 Control Rig: remove notion of slice context from graph and improve compilation performance
#jira UE-113382
#rb jack.cai

[CL 16367071 by Helge Mathee in ue5-main branch]
2021-05-18 10:22:22 -04:00

67 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "RigVMModel/RigVMNode.h"
#include "RigVMCore/RigVMStruct.h"
#include "UObject/StructOnScope.h"
#include "RigVMUnitNode.generated.h"
/**
* The Struct Node represents a Function Invocation of a RIGVM_METHOD
* declared on a USTRUCT. Struct Nodes have input / output pins for all
* struct UPROPERTY members.
*/
UCLASS(BlueprintType)
class RIGVMDEVELOPER_API URigVMUnitNode : public URigVMNode
{
GENERATED_BODY()
public:
// Override node functions
virtual FString GetNodeTitle() const override;
virtual FText GetToolTipText() const override;
virtual bool IsDefinedAsConstant() const override;
virtual bool IsDefinedAsVarying() const override;
virtual FName GetEventName() const override;
bool IsDeprecated() const;
FString GetDeprecatedMetadata() const;
// Returns the UStruct for this unit node
// (the struct declaring the RIGVM_METHOD)
UFUNCTION(BlueprintCallable, Category = RigVMUnitNode)
UScriptStruct* GetScriptStruct() const;
// return true if this node is a loop node
bool IsLoopNode() const;
// Returns the name of the declared RIGVM_METHOD
UFUNCTION(BlueprintCallable, Category = RigVMUnitNode)
FName GetMethodName() const;
// Returns the default value for the struct as text
UFUNCTION(BlueprintCallable, Category = RigVMUnitNode)
FString GetStructDefaultValue() const;
// Returns an instance of the struct with the current values.
// @param bUseDefault If set to true the default struct will be created - otherwise the struct will contains the values from the node
TSharedPtr<FStructOnScope> ConstructStructInstance(bool bUseDefault = false) const;
protected:
virtual FText GetToolTipTextForPin(const URigVMPin* InPin) const override;
private:
UPROPERTY()
UScriptStruct* ScriptStruct;
UPROPERTY()
FName MethodName;
friend class URigVMController;
};