Plugin Functions:
Blueprints Overview:
Code Sample: (Header)
/*
This C++ script, "VP Camera Recorder", (v2.1.7),
is part of a project created by Jonathan DeLeon.
Copyright (C) 2025 Jonathan DeLeon (contact@JonathanDeLeon.com)
This script is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This script is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Camera/CameraComponent.h"
#include "CameraRecorder.generated.h"
USTRUCT(BlueprintType)
struct FRecordedCameraFrame
{
GENERATED_BODY()
UPROPERTY() int32 FrameNumber;
UPROPERTY() FVector Location;
UPROPERTY() FRotator Rotation;
UPROPERTY() float FocalLength;
UPROPERTY() float Timestamp;
FRecordedCameraFrame()
: FrameNumber(0), Location(FVector::ZeroVector), Rotation(FRotator::ZeroRotator), FocalLength(0.0f), Timestamp(0.0f) {
}
};
UCLASS()
class GS_VIRTUALPRODSTUDIO_API ACameraRecorder : public AActor
{
GENERATED_BODY()
public:
ACameraRecorder();
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
UFUNCTION(BlueprintCallable, Category = "Camera Recording")
void StartRecording();
UFUNCTION(BlueprintCallable, Category = "Camera Recording")
void StopRecording();
UFUNCTION(BlueprintCallable, Category = "Camera Recording")
void SaveToJson();
private:
bool bIsRecording;
int32 FrameCounter;
float LastRecordedTime;
TArray<FRecordedCameraFrame> RecordedFrames;
};