CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
BlueprintLibary
PostProcessJsonUtils.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "CoreMinimal.h"
10
#include "Engine/PostProcessVolume.h"
11
#include "Kismet/BlueprintFunctionLibrary.h"
12
#include "Misc/Paths.h"
13
#include "PostProcessJsonUtils.generated.h"
14
15
USTRUCT(BlueprintType)
16
struct
FPostProcessSettingsWrapper
17
{
18
GENERATED_BODY()
19
20
UPROPERTY(EditAnywhere, BlueprintReadWrite)
21
FPostProcessSettings
Settings
;
22
};
23
24
25
class UPostProcessComponent;
26
class
USceneCaptureComponent2D
;
27
28
UCLASS()
29
class CARLA_API
UPostProcessJsonUtils
: public
UBlueprintFunctionLibrary
30
{
31
GENERATED_BODY()
32
33
public
:
34
UFUNCTION(BlueprintCallable, Category =
"PostProcess|JSON"
)
35
static
bool
SaveAllPostProcessToJson
(APostProcessVolume* Volume,
const
FString& FileName);
36
37
UFUNCTION(BlueprintCallable, Category =
"PostProcess|JSON"
)
38
static
bool
LoadAllPostProcessFromJsonToPostProcessVolume
(APostProcessVolume* Volume,
const
FString& FileName);
39
40
UFUNCTION(BlueprintCallable, Category =
"PostProcess|JSON"
)
41
static
bool
SaveAllPostProcessComponentToJson
(UPostProcessComponent * Volume,
const
FString& FileName);
42
43
UFUNCTION(BlueprintCallable, Category =
"PostProcess|JSON"
)
44
static
bool
LoadAllPostProcessFromJsonToPostProcessComponent
(UPostProcessComponent * Volume,
const
FString& FileName);
45
46
47
UFUNCTION(BlueprintCallable, Category =
"PostProcess|JSON"
)
48
static
bool
LoadAllPostProcessFromJsonToSceneCapture
(
USceneCaptureComponent2D
* SensorCamera,
const
FString& FileName);
49
50
// Names (without ".json") of every profile currently saved under
51
// Content/Carla/Config/PostProcess/. Backs the "Get Options" dropdown on
52
// APostProcessProfileVolume::ProfileName so artists can pick an existing
53
// profile or type a new one to create it on the next SaveProfile.
54
UFUNCTION(BlueprintCallable, BlueprintPure, Category =
"PostProcess|JSON"
)
55
static
TArray<FString>
GetAvailablePostProcessProfileNames
();
56
57
// The camera profile RGB sensors load when spawned without
58
// post_process_profile (or with the legacy "Default"). Set with
59
// carla.PostProcess.Profile.
60
UFUNCTION(BlueprintCallable, BlueprintPure, Category =
"PostProcess|JSON"
)
61
static
FString
GetActiveProfileName
();
62
63
// The camera profile the sky rig's post process (PIE viewport, spectator,
64
// server window) loads at BeginPlay. Set with carla.PostProcess.ViewportProfile.
65
UFUNCTION(BlueprintCallable, BlueprintPure, Category =
"PostProcess|JSON"
)
66
static
FString
GetViewportProfileName
();
67
68
// Profile name given to a sensor -> file to load. Empty or "Default" (any
69
// case) means the sensor default, GetActiveProfileName().
70
static
FString
ResolveProfileName
(
const
FString& Requested);
71
72
static
FString
GetPostProcessConfigPath
(
const
FString& FileName)
73
{
74
return
FPaths::ProjectContentDir() / TEXT(
"Carla/Config/PostProcess/"
) + FileName + TEXT(
".json"
);
75
}
76
};
UBlueprintFunctionLibrary
UPostProcessJsonUtils
Definition
PostProcessJsonUtils.h:30
UPostProcessJsonUtils::ResolveProfileName
static FString ResolveProfileName(const FString &Requested)
Definition
PostProcessJsonUtils.cpp:48
UPostProcessJsonUtils::LoadAllPostProcessFromJsonToPostProcessComponent
static bool LoadAllPostProcessFromJsonToPostProcessComponent(UPostProcessComponent *Volume, const FString &FileName)
Definition
PostProcessJsonUtils.cpp:94
UPostProcessJsonUtils::SaveAllPostProcessComponentToJson
static bool SaveAllPostProcessComponentToJson(UPostProcessComponent *Volume, const FString &FileName)
Definition
PostProcessJsonUtils.cpp:73
UPostProcessJsonUtils::LoadAllPostProcessFromJsonToPostProcessVolume
static bool LoadAllPostProcessFromJsonToPostProcessVolume(APostProcessVolume *Volume, const FString &FileName)
Definition
PostProcessJsonUtils.cpp:111
UPostProcessJsonUtils::LoadAllPostProcessFromJsonToSceneCapture
static bool LoadAllPostProcessFromJsonToSceneCapture(USceneCaptureComponent2D *SensorCamera, const FString &FileName)
Definition
PostProcessJsonUtils.cpp:129
UPostProcessJsonUtils::GetPostProcessConfigPath
static FString GetPostProcessConfigPath(const FString &FileName)
Definition
PostProcessJsonUtils.h:72
UPostProcessJsonUtils::GetActiveProfileName
static FString GetActiveProfileName()
Definition
PostProcessJsonUtils.cpp:38
UPostProcessJsonUtils::SaveAllPostProcessToJson
static bool SaveAllPostProcessToJson(APostProcessVolume *Volume, const FString &FileName)
Definition
PostProcessJsonUtils.cpp:57
UPostProcessJsonUtils::GetAvailablePostProcessProfileNames
static TArray< FString > GetAvailablePostProcessProfileNames()
Definition
PostProcessJsonUtils.cpp:146
UPostProcessJsonUtils::GetViewportProfileName
static FString GetViewportProfileName()
Definition
PostProcessJsonUtils.cpp:43
USceneCaptureComponent2D
FPostProcessSettingsWrapper
Definition
PostProcessJsonUtils.h:17
FPostProcessSettingsWrapper::Settings
FPostProcessSettings Settings
Definition
PostProcessJsonUtils.h:21
Generated by
1.18.0