You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
"Call function" anim node: - Adds the ability to call functions at different points in the anim graph execution (and under different conditions, e.g. when a branch has started blending in). Only thread-safe functions are allowed to be called. - Adds a thread-safe override point BlueprintThreadSafeUpdateAnimation, called on worker threads for the main instance and for linked instances when they are relevant in the graph (only one call per frame for linked layer instances). Subsystems: - Added new override points pre/post event graph(s) (moved override point for worker thread work to around the thread safe update function call). Improves property access integration: - Property access now shows (and allows the user to override) the call site of accesses. This is to allow users to see when their property access calls will be made, hopefully making its use less confusing for power users. - Tweaked UX for property access nodes and dropdowns. - Anim node pins now have property access bindings in-line on the pin. Also adds the abilility for the anim graph to opt-in (via a config flag) to more stringent thread safety checks. Disabled by default for now as this requires content fixup. #jira UE-115745 - Anim Blueprint Encapsulation #rb Jurre.deBaare [CL 16434092 by Thomas Sarkanen in ue5-main branch]
74 lines
2.6 KiB
C++
74 lines
2.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "AnimGraphNode_Base.h"
|
|
#include "AnimNodes/AnimNode_CallFunction.h"
|
|
#include "Engine/MemberReference.h"
|
|
|
|
#include "AnimGraphNode_CallFunction.generated.h"
|
|
|
|
class UEdGraph;
|
|
class UK2Node_CallFunction;
|
|
|
|
UCLASS(MinimalAPI, meta=(Keywords = "Event"))
|
|
class UAnimGraphNode_CallFunction : public UAnimGraphNode_Base
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
private:
|
|
// Inner graph we maintain to hook into the function call machinery
|
|
UPROPERTY()
|
|
UEdGraph* InnerGraph;
|
|
|
|
// Inner node we maintain to hook into the function call machinery
|
|
UPROPERTY()
|
|
UK2Node_CallFunction* CallFunctionPrototype;
|
|
|
|
UPROPERTY(EditAnywhere, Category=Settings)
|
|
FAnimNode_CallFunction Node;
|
|
|
|
// Delegate handles used to hook into inner graph & function nodes
|
|
FDelegateHandle GraphChangedHandle;
|
|
FDelegateHandle PinRenamedHandle;
|
|
|
|
// UObject interface
|
|
virtual void PostLoad() override;
|
|
|
|
// UEdGraphNode interface
|
|
virtual FLinearColor GetNodeTitleColor() const override;
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
virtual FText GetTooltipText() const override;
|
|
virtual void AllocateDefaultPins() override;
|
|
virtual void ReallocatePinsDuringReconstruction(TArray<UEdGraphPin*>& InOldPins) override;
|
|
virtual UObject* GetJumpTargetForDoubleClick() const override;
|
|
virtual void JumpToDefinition() const override;
|
|
virtual void ValidateNodeDuringCompilation(FCompilerResultsLog& MessageLog) const override;
|
|
|
|
// UK2Node interface
|
|
virtual FText GetMenuCategory() const override;
|
|
virtual void ExpandNode(FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
|
|
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
|
|
|
|
// UAnimGraphNode_Base interface
|
|
virtual void GetRequiredExtensions(TArray<TSubclassOf<UAnimBlueprintExtension>>& OutExtensions) const override;
|
|
virtual bool ShouldCreateStructEvalHandlers() const override { return false; }
|
|
|
|
private:
|
|
void AllocateFunctionPins();
|
|
|
|
/** Sets up node internals */
|
|
void SetupFromFunction(UFunction* InFunction);
|
|
void BindDelegates();
|
|
|
|
/** Checks to see if the passed-in function is blacklisted (i.e. cannot be called) in anim graphs. */
|
|
bool IsFunctionBlacklisted(const UFunction* InFunction) const;
|
|
|
|
/** Validate the function's parameters to check if it can be called in anim graphs */
|
|
bool AreFunctionParamsValid(const UFunction* InFunction) const;
|
|
|
|
/** Validates a function. Used for populating menu actions and verifying already-referenced functions */
|
|
bool ValidateFunction(const UFunction* InFunction, FCompilerResultsLog* InMessageLog = nullptr) const;
|
|
};
|