ue-mcp 1.0.45 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tool-counts.json
CHANGED
package/package.json
CHANGED
|
@@ -291,6 +291,7 @@ namespace UEMCPPIE
|
|
|
291
291
|
ReplayActorCache.Reset();
|
|
292
292
|
ActorDriftAccum.Reset();
|
|
293
293
|
FramesCaptured = 0;
|
|
294
|
+
CaptureFrameCounter = 0;
|
|
294
295
|
CaptureDir.Reset();
|
|
295
296
|
NextStepIndex = 0;
|
|
296
297
|
ExecutedSteps = 0;
|
|
@@ -597,18 +598,21 @@ namespace UEMCPPIE
|
|
|
597
598
|
}
|
|
598
599
|
IFileManager::Get().MakeDirectory(*CaptureDir, true);
|
|
599
600
|
}
|
|
600
|
-
const uint64 FrameIdx = static_cast<uint64>(
|
|
601
|
+
const uint64 FrameIdx = static_cast<uint64>(CaptureFrameCounter);
|
|
601
602
|
if ((FrameIdx % static_cast<uint64>(Pending.CaptureFrameEvery)) == 0)
|
|
602
603
|
{
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
if (Viewport)
|
|
604
|
+
FViewport* Viewport = nullptr;
|
|
605
|
+
if (GEngine && GEngine->GameViewport)
|
|
606
606
|
{
|
|
607
|
+
Viewport = GEngine->GameViewport->Viewport;
|
|
608
|
+
}
|
|
609
|
+
if (Viewport && Viewport->GetSizeXY().X > 0)
|
|
610
|
+
{
|
|
611
|
+
const int32 W = Viewport->GetSizeXY().X;
|
|
612
|
+
const int32 H = Viewport->GetSizeXY().Y;
|
|
607
613
|
TArray<FColor> Pixels;
|
|
608
|
-
if (Viewport->ReadPixels(Pixels))
|
|
614
|
+
if (Viewport->ReadPixels(Pixels) && Pixels.Num() == W * H)
|
|
609
615
|
{
|
|
610
|
-
const int32 W = Viewport->GetSizeXY().X;
|
|
611
|
-
const int32 H = Viewport->GetSizeXY().Y;
|
|
612
616
|
const FString FullPath = CaptureDir / FString::Printf(TEXT("frame_%05llu.png"), FrameIdx);
|
|
613
617
|
AsyncTask(ENamedThreads::AnyBackgroundThreadNormalTask,
|
|
614
618
|
[Pixels = MoveTemp(Pixels), W, H, FullPath]()
|
|
@@ -619,8 +623,20 @@ namespace UEMCPPIE
|
|
|
619
623
|
});
|
|
620
624
|
FramesCaptured++;
|
|
621
625
|
}
|
|
626
|
+
else
|
|
627
|
+
{
|
|
628
|
+
UE_LOG(LogMCPBridge, Warning, TEXT("[PIE-REP] ReadPixels failed: %dx%d pixels=%d"),
|
|
629
|
+
W, H, Pixels.Num());
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
else
|
|
633
|
+
{
|
|
634
|
+
UE_LOG(LogMCPBridge, Warning, TEXT("[PIE-REP] No viewport for capture (GameViewport=%s Viewport=%s)"),
|
|
635
|
+
(GEngine && GEngine->GameViewport) ? TEXT("valid") : TEXT("null"),
|
|
636
|
+
Viewport ? TEXT("valid") : TEXT("null"));
|
|
622
637
|
}
|
|
623
638
|
}
|
|
639
|
+
CaptureFrameCounter++;
|
|
624
640
|
}
|
|
625
641
|
|
|
626
642
|
// Drift sampling: sample current pawn state + compare to source by
|
|
@@ -160,6 +160,7 @@ namespace UEMCPPIE
|
|
|
160
160
|
TMap<FString, TWeakObjectPtr<AActor>> ReplayActorCache;
|
|
161
161
|
TMap<FString, FActorDrift> ActorDriftAccum;
|
|
162
162
|
int32 FramesCaptured = 0;
|
|
163
|
+
uint64 CaptureFrameCounter = 0;
|
|
163
164
|
FString CaptureDir;
|
|
164
165
|
|
|
165
166
|
// Eject state: controller unpossesses pawn on replay start.
|