TakeRecorder.AllowMenuExtensions

TakeRecorder.AllowMenuExtensions

#Overview

name: TakeRecorder.AllowMenuExtensions

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 TakeRecorder.AllowMenuExtensions is to control the extension of menu options in the Take Recorder system within Unreal Engine 5. This setting variable is specifically related to the Virtual Production functionality, particularly the Takes plugin.

This setting variable is primarily used in the TakeRecorderSources module, which is part of the Virtual Production plugin suite in Unreal Engine 5. Based on the callsites, it’s clear that this variable is used to determine whether certain menu extensions should be allowed in the editor.

The value of this variable is set as a console variable (cvar) using FAutoConsoleVariableRef. It’s initialized with a default value of true, meaning menu extensions are allowed by default.

The associated variable AllowMenuExtensions interacts directly with TakeRecorder.AllowMenuExtensions. They share the same value, with AllowMenuExtensions being the actual boolean variable used in the code, while TakeRecorder.AllowMenuExtensions is the console variable name used to modify this setting at runtime.

Developers must be aware that:

  1. This variable only has an effect in editor builds (WITH_EDITOR is defined).
  2. It’s marked as a cheat variable (ECVF_Cheat), which means it’s intended for debugging or development purposes and should not be exposed to end-users.
  3. Changing this variable will affect the presence of certain menu options in the Take Recorder system.

Best practices when using this variable include:

  1. Use it for debugging or development purposes only, not in production builds.
  2. Be cautious when disabling menu extensions, as it may limit functionality for users of the Take Recorder system.
  3. If you’re extending the Take Recorder system with custom menu options, check this variable before adding your extensions to respect the user’s settings.

Regarding the associated variable AllowMenuExtensions:

The purpose of AllowMenuExtensions is to provide a direct, in-code boolean flag that reflects the state of the TakeRecorder.AllowMenuExtensions console variable.

This variable is used within the TakeRecorderSources module to conditionally extend the level viewport context menu. Specifically, it’s checked in the ExtendLevelViewportContextMenu function to determine whether to proceed with adding menu extensions.

The value of AllowMenuExtensions is set initially to true and can be modified through the console variable system.

Developers should be aware that this variable directly controls the behavior of menu extension logic in the Take Recorder system. When it’s false, certain context menu options related to Take Recorder functionality will not be added to the level viewport.

Best practices for using AllowMenuExtensions include:

  1. Use it as a quick check before attempting to add menu extensions in any custom code that extends the Take Recorder system.
  2. Remember that its value can be changed at runtime through the console, so always check its current value rather than assuming a default.
  3. If you’re debugging issues with missing menu options in the Take Recorder system, checking the state of this variable should be one of your first steps.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/Takes/Source/TakeRecorderSources/Private/TakeRecorderSourcesModule.cpp:61

Scope (from outer to inner):

file
namespace    TakeRecorderSources

Source code excerpt:

#if WITH_EDITOR
	static bool AllowMenuExtensions = true;
	FAutoConsoleVariableRef CVarAllowMenuExtensions(TEXT("TakeRecorder.AllowMenuExtensions"), AllowMenuExtensions, TEXT(""), ECVF_Cheat);
#endif // WITH_EDITOR
}

namespace
{
	static AActor* FindActorByLabel(const FString& ActorNameStr, UWorld* InWorld, bool bFuzzy = false)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/Takes/Source/TakeRecorderSources/Private/TakeRecorderSourcesModule.cpp:60

Scope (from outer to inner):

file
namespace    TakeRecorderSources

Source code excerpt:

{
#if WITH_EDITOR
	static bool AllowMenuExtensions = true;
	FAutoConsoleVariableRef CVarAllowMenuExtensions(TEXT("TakeRecorder.AllowMenuExtensions"), AllowMenuExtensions, TEXT(""), ECVF_Cheat);
#endif // WITH_EDITOR
}

namespace
{
	static AActor* FindActorByLabel(const FString& ActorNameStr, UWorld* InWorld, bool bFuzzy = false)

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/Takes/Source/TakeRecorderSources/Private/TakeRecorderSourcesModule.cpp:391

Scope (from outer to inner):

file
class        class FTakeRecorderSourcesModule : public IModuleInterface, private FSelfRegisteringExec
function     TSharedRef<FExtender> ExtendLevelViewportContextMenu

Source code excerpt:


#if WITH_EDITOR
		if (!TakeRecorderSources::AllowMenuExtensions)
		{
			return Extender;
		}
#endif
		if (SelectedActors.Num() > 0)
		{