CogEngine: Fix and improve Plot window

CogEngine: Fix and improve the Plot window
- Fix ImPlot assert
- Improve UI

CogSample:
-  Add Inputs and AnimNotify plot events
- Fix ability system warning
This commit is contained in:
Arnaud Jamin
2025-01-11 00:31:53 -05:00
parent 269f8ae469
commit 2f1361a412
12 changed files with 482 additions and 130 deletions
+52
View File
@@ -0,0 +1,52 @@
#include "CogSampleAnimNotify.h"
#include "CogCommon.h"
#include "Animation/AnimSequenceBase.h"
#include "Components/SkeletalMeshComponent.h"
#if ENABLE_COG
#include "CogDebugPlot.h"
#endif
//--------------------------------------------------------------------------------------------------------------------------
UCogSampleAnimNotify::UCogSampleAnimNotify(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bIsNativeBranchingPoint = true;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleAnimNotify::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
{
Super::Notify(MeshComp, Animation, EventReference);
#if ENABLE_COG
FCogDebugPlot::PlotEventInstant(MeshComp->GetOwner(), "Anim Notify", GetFName())
.AddParam("Name", GetNameSafe(this))
.AddParam("Animation", GetNameSafe(Animation))
.AddParam("Debug Info", GetDebugInfo());
#endif
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleAnimNotify::BranchingPointNotify(FBranchingPointNotifyPayload& BranchingPointPayload)
{
//--------------------------------------------------------------------------------------------------------
// Replace UAnimNotify::BranchingPointNotify to fill the EventReference with the NotifyEvent for
// UGPCoreAnimMotifyFunctionLibrary::AnimNotifyEventReferenceGetMontage to work properly
//--------------------------------------------------------------------------------------------------------
// Super::BranchingPointNotify(BranchingPointPayload);
const FAnimNotifyEventReference EventReference(BranchingPointPayload.NotifyEvent,
BranchingPointPayload.SequenceAsset);
Notify(BranchingPointPayload.SkelMeshComponent, BranchingPointPayload.SequenceAsset, EventReference);
}
//--------------------------------------------------------------------------------------------------------------------------
FString UCogSampleAnimNotify::GetDebugInfo_Implementation() const
{
FString DebugInfo;
return DebugInfo;
}