DefaultInputProfile

DefaultInputProfile

#Overview

name: DefaultInputProfile

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DefaultInputProfile is to define the default input configuration for Virtual Camera components in Unreal Engine’s Virtual Production system. This setting variable is specifically used within the Virtual Camera Core plugin to manage input profiles for virtual camera controls.

The DefaultInputProfile setting is primarily utilized by the Virtual Camera Core plugin, which is part of Unreal Engine’s Virtual Production toolset. It’s referenced in the VCamCore module, specifically in the VCamInputSettings and VCamComponent classes.

The value of this variable is set through the UVCamInputSettings class, which inherits from UDeveloperSettings. This means it can be configured in the project settings. The SetDefaultInputProfile function allows for programmatic updates to this value, which are then saved to the config file.

DefaultInputProfile interacts closely with the InputProfiles variable, which is a map of named input profiles. The DefaultInputProfile specifies which of these profiles should be used by default for new VCamComponents.

Developers should be aware that:

  1. Changing DefaultInputProfile affects newly created VCamComponents, not existing ones.
  2. The value of DefaultInputProfile must correspond to a key in the InputProfiles map to be effective.

Best practices when using this variable include:

  1. Ensure that the DefaultInputProfile always points to a valid entry in InputProfiles.
  2. Use the provided setter functions (SetDefaultInputProfile and SetInputProfiles) to modify these values, as they handle config saving automatically.
  3. Consider the impact on existing scenes and components when changing the default profile, and provide a way for users to update existing components if necessary.
  4. Document any changes to the default input profile, as it may affect the behavior of virtual camera controls across the project.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Config/DefaultVCamInputSettings.ini:2, section: [/Script/VCamCore.VCamInputSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Source/VCamCore/Private/Input/VCamInputSettings.cpp:27

Scope (from outer to inner):

file
function     void UVCamInputSettings::SetDefaultInputProfile

Source code excerpt:

	if (InputProfiles.Contains(NewDefaultInputProfile))
	{
		DefaultInputProfile = NewDefaultInputProfile;
		SaveConfig();
	}
}

void UVCamInputSettings::SetInputProfiles(const TMap<FName, FVCamInputProfile>& NewInputProfiles)
{

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Source/VCamCore/Private/VCamComponent.cpp:85

Scope (from outer to inner):

file
function     void UVCamComponent::OnComponentCreated

Source code excerpt:

	// After creation, the InputProfile should be initialized to the project setting's default mappings
	const UVCamInputSettings* VCamInputSettings = GetDefault<UVCamInputSettings>();
	const FVCamInputProfile* NewInputProfile = VCamInputSettings ? VCamInputSettings->InputProfiles.Find(VCamInputSettings->DefaultInputProfile) : nullptr;
	if (NewInputProfile)
	{
		InputProfile = *NewInputProfile;
	}

	// ApplyComponentInstanceData will handle initialization if the construction script is being re-run on a Blueprint created component.

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Source/VCamCore/Public/Input/VCamInputSettings.h:34

Scope (from outer to inner):

file
class        class UVCamInputSettings : public UDeveloperSettings

Source code excerpt:

	/** The profile that VCam components should default to. */
	UPROPERTY(EditAnywhere, Config, BlueprintReadWrite, BlueprintSetter=SetDefaultInputProfile, Category="Input", meta=(GetOptions=GetInputProfileNames))
	FName DefaultInputProfile;

	/** A bunch of profiles that components can switch between */
	UPROPERTY(EditAnywhere, Config, BlueprintReadWrite, BlueprintSetter=SetInputProfiles, Category="Input")
	TMap<FName, FVCamInputProfile> InputProfiles;

	/** Gets the settings object. */

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/VirtualCameraCore/Source/VCamCore/Public/Input/VCamInputSettings.h:44

Scope (from outer to inner):

file
function     class VCAMCORE_API UVCamInputSettings : public UDeveloperSettings { GENERATED_BODY

Source code excerpt:

	static UVCamInputSettings* GetVCamInputSettings();

	/** Sets DefaultInputProfile and saves it out to the config.  */
	UFUNCTION(BlueprintCallable, Category="VCam Input")
	void SetDefaultInputProfile(const FName NewDefaultInputProfile);
	/** Updates InputProfiles and save it out to the config. */
	UFUNCTION(BlueprintCallable, Category="VCam Input")
	void SetInputProfiles(const TMap<FName, FVCamInputProfile>& NewInputProfiles);