tools: visual-review screenshot pipeline
- AGigLineShotActor (dev-only): walks a fixed camera list in -game mode, captures via FScreenshotRequest, quits. Test content only. - ue_build_review_map.py builds /Game/Test/ReviewMap from current content (gray floor, key light, sky, MPFB character, 1 m scale cubes). - render_screenshots.sh: build map -> run game -> collect PNGs into gitignored Screenshots/. - Screenshots/README.md (committed) describes each capture with approval state; AGENTS.md gains the visual-review instructions.
This commit is contained in:
1 parent
774d810dab
commit
bbb3e147b3
12 files changed
+525
-1
No files matched your search
@@ -0,0 +1,78 @@
|
||||
#include "GigLineShotActor.h"
|
||||
|
||||
#include "Camera/CameraActor.h"
|
||||
#include "Engine/World.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "UnrealClient.h"
|
||||
|
||||
AGigLineShotActor::AGigLineShotActor()
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
PrimaryActorTick.bStartWithTickEnabled = true;
|
||||
}
|
||||
|
||||
void AGigLineShotActor::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
NextShot();
|
||||
}
|
||||
|
||||
void AGigLineShotActor::Tick(float DeltaSeconds)
|
||||
{
|
||||
Super::Tick(DeltaSeconds);
|
||||
|
||||
if (bWaitingForSettle)
|
||||
{
|
||||
SettleCountdown -= DeltaSeconds;
|
||||
if (SettleCountdown <= 0.f)
|
||||
{
|
||||
bWaitingForSettle = false;
|
||||
const FString FileName = FString::Printf(TEXT("review-%02d-%s"), CurrentShot,
|
||||
CurrentShot < ShotNames.Num() ? *ShotNames[CurrentShot] : *FString::FromInt(CurrentShot));
|
||||
// Resolution is the game window's; the runner passes -ResX/-ResY.
|
||||
FScreenshotRequest::RequestScreenshot(FileName, false, false);
|
||||
bWaitingForScreenshot = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (bWaitingForScreenshot && !FScreenshotRequest::IsScreenshotRequested())
|
||||
{
|
||||
bWaitingForScreenshot = false;
|
||||
UE_LOG(LogTemp, Log, TEXT("GigLineShotActor: captured %s"), *FScreenshotRequest::GetFilename());
|
||||
++CurrentShot;
|
||||
NextShot();
|
||||
}
|
||||
}
|
||||
|
||||
void AGigLineShotActor::NextShot()
|
||||
{
|
||||
if (!PlayerController)
|
||||
{
|
||||
PlayerController = GetWorld()->GetFirstPlayerController();
|
||||
}
|
||||
|
||||
if (CurrentShot >= ShotLocations.Num() || !PlayerController)
|
||||
{
|
||||
UE_LOG(LogTemp, Log, TEXT("GigLineShotActor: done (%d shots)"), CurrentShot);
|
||||
if (bQuitWhenDone)
|
||||
{
|
||||
PlayerController->ConsoleCommand(TEXT("quit"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentCamera)
|
||||
{
|
||||
CurrentCamera->Destroy();
|
||||
}
|
||||
|
||||
FActorSpawnParameters Params;
|
||||
Params.ObjectFlags |= RF_Transient;
|
||||
CurrentCamera = GetWorld()->SpawnActor<ACameraActor>(
|
||||
ACameraActor::StaticClass(), ShotLocations[CurrentShot], ShotRotations[CurrentShot], Params);
|
||||
PlayerController->SetViewTarget(CurrentCamera);
|
||||
|
||||
SettleCountdown = SettleSeconds;
|
||||
bWaitingForSettle = true;
|
||||
}
|
||||
Reference in new issue
Block a user