EM_Task/UnrealEd/Private/ThumbnailRendering/SceneThumbnailInfo.cpp

41 lines
1.2 KiB
C++
Raw Permalink Normal View History

2026-02-13 16:18:33 +08:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ThumbnailRendering/SceneThumbnailInfo.h"
#include "UObject/AnimPhysObjectVersion.h"
USceneThumbnailInfo::USceneThumbnailInfo(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
OrbitPitch = -11.25;
OrbitYaw = -157.5;
OrbitZoom = 0;
}
void USceneThumbnailInfo::ResetToDefault()
{
const USceneThumbnailInfo* Default = GetDefault<USceneThumbnailInfo>();
OrbitPitch = Default->OrbitPitch;
OrbitYaw = Default->OrbitYaw;
OrbitZoom = Default->OrbitZoom;
}
bool USceneThumbnailInfo::DiffersFromDefault() const
{
const USceneThumbnailInfo* Default = GetDefault<USceneThumbnailInfo>();
return OrbitPitch != Default->OrbitPitch ||
OrbitYaw != Default->OrbitYaw ||
OrbitZoom != Default->OrbitZoom;
}
void USceneThumbnailInfo::Serialize(FArchive& Ar)
{
Super::Serialize(Ar);
Ar.UsingCustomVersion(FAnimPhysObjectVersion::GUID);
if (Ar.CustomVer(FAnimPhysObjectVersion::GUID) < FAnimPhysObjectVersion::ThumbnailSceneInfoAndAssetImportDataAreTransactional)
{
SetFlags(RF_Transactional);
}
}