Files
UnrealEngineUWP/Engine/Source/Developer/RigVMDeveloper/Public/RigVMModel/Nodes/RigVMVariableNode.h
sara schvartzman a004ea816a ControlRig: Adding local variables to CR graphs UI
#jira UE-110373
#rb helge.mathee

[CL 16568265 by sara schvartzman in ue5-main branch]
2021-06-07 06:49:07 -04:00

72 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "RigVMCore/RigVMExternalVariable.h"
#include "RigVMModel/RigVMNode.h"
#include "RigVMModel/RigVMVariableDescription.h"
#include "RigVMVariableNode.generated.h"
/**
* The Variable Node represents a mutable value / local state within the
* the Function / Graph. Variable Node's can be a getter or a setter.
* Getters are pure nodes with just an output value pin, while setters
* are mutable nodes with an execute and input value pin.
*/
UCLASS(BlueprintType)
class RIGVMDEVELOPER_API URigVMVariableNode : public URigVMNode
{
GENERATED_BODY()
public:
// Default constructor
URigVMVariableNode();
// Override of node title
virtual FString GetNodeTitle() const;
// Returns the name of the variable
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
FName GetVariableName() const;
// Returns true if this node is a variable getter
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
bool IsGetter() const;
// Returns true if this variable is a local variable
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
bool IsLocalVariable() const;
// Returns the C++ data type of the variable
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
FString GetCPPType() const;
// Returns the C++ data type struct of the variable (or nullptr)
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
UObject* GetCPPTypeObject() const;
// Returns the default value of the variable as a string
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
FString GetDefaultValue() const;
// Returns this variable node's variable description
UFUNCTION(BlueprintCallable, Category = RigVMVariableNode)
FRigVMGraphVariableDescription GetVariableDescription() const;
// Override of node title
virtual FLinearColor GetNodeColor() const override { return FLinearColor::Blue; }
virtual bool IsDefinedAsVarying() const override { return true; }
private:
static const FString VariableName;
static const FString ValueName;
friend class URigVMController;
friend class URigVMCompiler;
friend class FRigVMVarExprAST;
friend class FRigVMParserAST;
};