From ea3df0d69b022e951ef668afc6217d2e39154868 Mon Sep 17 00:00:00 2001 From: Michael Delva Date: Fri, 17 May 2024 17:17:24 +0200 Subject: [PATCH] Created blueprint function to get the best layer out of an anim layer set --- .../Animation/GBFAnimationFunctionLibrary.cpp | 8 ++++++++ .../Animation/GBFAnimationFunctionLibrary.h | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Source/GameBaseFramework/Private/Animation/GBFAnimationFunctionLibrary.cpp create mode 100644 Source/GameBaseFramework/Public/Animation/GBFAnimationFunctionLibrary.h diff --git a/Source/GameBaseFramework/Private/Animation/GBFAnimationFunctionLibrary.cpp b/Source/GameBaseFramework/Private/Animation/GBFAnimationFunctionLibrary.cpp new file mode 100644 index 00000000..db4b9e85 --- /dev/null +++ b/Source/GameBaseFramework/Private/Animation/GBFAnimationFunctionLibrary.cpp @@ -0,0 +1,8 @@ +#include "Animation/GBFAnimationFunctionLibrary.h" + +#include "Animation/GBFAnimLayerSelectionSet.h" + +TSubclassOf UGBFAnimationFunctionLibrary::SelectBestLayerFromAnimLayerSelectionSet( const FGBFAnimLayerSelectionSet & anim_layer_selection_set, const FGameplayTagContainer & cosmetic_tags ) +{ + return anim_layer_selection_set.SelectBestLayer( cosmetic_tags ); +} diff --git a/Source/GameBaseFramework/Public/Animation/GBFAnimationFunctionLibrary.h b/Source/GameBaseFramework/Public/Animation/GBFAnimationFunctionLibrary.h new file mode 100644 index 00000000..99062ebf --- /dev/null +++ b/Source/GameBaseFramework/Public/Animation/GBFAnimationFunctionLibrary.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +#include "GBFAnimationFunctionLibrary.generated.h" + +struct FGBFAnimLayerSelectionSet; +class UAnimInstance; + +UCLASS() +class GAMEBASEFRAMEWORK_API UGBFAnimationFunctionLibrary final : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + UFUNCTION( BlueprintCallable ) + static TSubclassOf< UAnimInstance > SelectBestLayerFromAnimLayerSelectionSet( const FGBFAnimLayerSelectionSet & anim_layer_selection_set, const FGameplayTagContainer & cosmetic_tags ); +};