Files
integration/Plugins/UEWingman/Deprecated/AnimBlueprint_ListSyncGroups.h

66 lines
1.7 KiB
C
Raw Normal View History

2026-03-08 22:17:14 -04:00
#pragma once
#include "CoreMinimal.h"
2026-03-18 10:17:58 -04:00
#include "WingServer.h"
#include "WingHandler.h"
#include "WingFetcher.h"
#include "WingUtils.h"
2026-03-08 22:17:14 -04:00
#include "Animation/AnimBlueprint.h"
#include "AnimGraphNode_Base.h"
2026-03-12 00:44:17 -04:00
#include "AnimBlueprint_ListSyncGroups.generated.h"
2026-03-08 22:17:14 -04:00
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
2026-03-15 19:32:09 -04:00
UCLASS()
2026-03-18 10:17:58 -04:00
class UWing_AnimBlueprint_ListSyncGroups : public UObject, public IWingHandler
2026-03-08 22:17:14 -04:00
{
GENERATED_BODY()
public:
2026-03-10 07:17:42 -04:00
UPROPERTY(meta=(Description="Path to an Animation Blueprint, e.g. /Game/Foo/ABP_Character"))
2026-03-15 17:20:31 -04:00
FString Blueprint;
2026-03-08 22:17:14 -04:00
virtual FString GetDescription() const override
{
return TEXT("List all sync group names used in an Animation Blueprint.");
}
virtual void Handle() override
2026-03-08 22:17:14 -04:00
{
2026-03-18 10:17:58 -04:00
WingFetcher F;
2026-03-15 17:20:31 -04:00
UAnimBlueprint* AnimBP = F.Walk(Blueprint).Cast<UAnimBlueprint>();
2026-03-10 07:17:42 -04:00
if (!AnimBP) return;
2026-03-08 22:17:14 -04:00
// Walk all anim nodes to collect sync group names
TSet<FString> SyncGroupNames;
2026-03-18 10:17:58 -04:00
for (UAnimGraphNode_Base* AnimNode : WingUtils::AllNodes<UAnimGraphNode_Base>(AnimBP))
2026-03-08 22:17:14 -04:00
{
for (TFieldIterator<FNameProperty> PropIt(AnimNode->GetClass()); PropIt; ++PropIt)
{
if (PropIt->GetName().Contains(TEXT("SyncGroup")) || PropIt->GetName().Contains(TEXT("GroupName")))
{
FName GroupValue = PropIt->GetPropertyValue_InContainer(AnimNode);
if (!GroupValue.IsNone())
{
SyncGroupNames.Add(GroupValue.ToString());
}
}
}
}
2026-03-10 07:17:42 -04:00
if (SyncGroupNames.Num() == 0)
2026-03-08 22:17:14 -04:00
{
2026-03-18 10:17:58 -04:00
UWingServer::Print(TEXT("No sync groups found.\n"));
2026-03-10 07:17:42 -04:00
return;
2026-03-08 22:17:14 -04:00
}
2026-03-10 07:17:42 -04:00
for (const FString& Group : SyncGroupNames)
{
2026-03-18 10:17:58 -04:00
UWingServer::Printf(TEXT("%s\n"), *Group);
2026-03-10 07:17:42 -04:00
}
2026-03-08 22:17:14 -04:00
}
};