r.Photography.Available

r.Photography.Available

#Overview

name: r.Photography.Available

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Photography.Available is to indicate whether the photography system in Unreal Engine is potentially available to the user. It is a read-only console variable that represents the availability of a functioning photography back-end.

This setting variable is primarily used by the Camera Photography module within Unreal Engine’s runtime system. It’s part of the engine’s camera and photography-related functionality.

The value of this variable is set in the FCameraPhotographyManager constructor. It’s initialized to 1 by default, but it’s then set based on whether a photography implementation is supported (bIsSupported).

The r.Photography.Available variable interacts directly with its associated variable CVarPhotographyAvailable. They share the same value, and CVarPhotographyAvailable is the actual TAutoConsoleVariable object that controls the setting.

Developers must be aware that this is a read-only variable, meaning it cannot be modified directly through console commands or configuration files. Its value is determined by the engine based on the availability of the photography system.

Best practices when using this variable include:

  1. Using it as a check before attempting to use photography features.
  2. Not attempting to modify its value, as it’s meant to be read-only.
  3. Understanding that a value of 1 doesn’t guarantee photography features will work, only that they’re potentially available.

Regarding the associated variable CVarPhotographyAvailable:

The purpose of CVarPhotographyAvailable is to serve as the actual console variable object that represents r.Photography.Available in the code.

It’s used within the Camera Photography module of Unreal Engine. Specifically, it’s defined and set in the CameraPhotography.cpp file.

The value of CVarPhotographyAvailable is initially set to 1 when it’s defined, but it’s then updated in the FCameraPhotographyManager constructor based on whether the photography implementation is supported.

CVarPhotographyAvailable directly interacts with r.Photography.Available, as they represent the same setting.

Developers should be aware that while CVarPhotographyAvailable is the actual variable object, they should generally refer to r.Photography.Available in console commands or when checking the photography system’s availability.

Best practices for CVarPhotographyAvailable include:

  1. Not modifying it directly in code, as it’s meant to be controlled by the engine.
  2. Using it to check the photography system’s availability when needed in C++ code.
  3. Understanding that it’s a read-only variable, so attempts to modify it through normal means will fail.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraPhotography.cpp:12

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarPhotographyAvailable(
	TEXT("r.Photography.Available"),
	1,
	TEXT("(Read-only) If 1, the photography system is potentially available to the user.\n")
	TEXT("Otherwise, a functioning back-end is not available."), 
	ECVF_ReadOnly);

/////////////////////////////////////////////////

#Associated Variable and Callsites

This variable is associated with another variable named CVarPhotographyAvailable. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraPhotography.cpp:11

Scope: file

Source code excerpt:

/////////////////////////////////////////////////

static TAutoConsoleVariable<int32> CVarPhotographyAvailable(
	TEXT("r.Photography.Available"),
	1,
	TEXT("(Read-only) If 1, the photography system is potentially available to the user.\n")
	TEXT("Otherwise, a functioning back-end is not available."), 
	ECVF_ReadOnly);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraPhotography.cpp:41

Scope (from outer to inner):

file
function     FCameraPhotographyManager::FCameraPhotographyManager

Source code excerpt:

	}

	CVarPhotographyAvailable->Set(bIsSupported ? 1 : 0);	
}

FCameraPhotographyManager::~FCameraPhotographyManager()
{
	if (ActiveImpl.IsValid())
	{