CurveEditor.UseCurveCache

CurveEditor.UseCurveCache

#Overview

name: CurveEditor.UseCurveCache

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 CurveEditor.UseCurveCache is to control the caching behavior of curve values in the Curve Editor. It is a console variable that determines whether curve values should be cached or regenerated each time they are needed.

This setting variable is primarily used in the Curve Editor module of Unreal Engine, specifically within the SCurveEditorView class. It affects the performance and behavior of curve editing and rendering in the editor.

The value of this variable is set using a TAutoConsoleVariable, which allows it to be changed at runtime through console commands. By default, it is set to true, meaning curve caching is enabled.

The associated variable CVarUseCurveCache directly interacts with CurveEditor.UseCurveCache. It is the C++ representation of the console variable and is used to access its value within the code.

Developers must be aware that:

  1. Enabling curve caching (default behavior) can improve performance by avoiding unnecessary regeneration of curve values.
  2. Disabling curve caching will always regenerate curve values, which might be useful for debugging or ensuring up-to-date values at the cost of performance.

Best practices when using this variable include:

  1. Leave it enabled (true) for normal development to benefit from improved performance.
  2. Consider disabling it temporarily if you suspect caching-related issues or need to ensure curve values are always freshly generated.
  3. Use the console command to toggle this setting during runtime for testing purposes.

Regarding the associated variable CVarUseCurveCache:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/CurveEditor/Private/SCurveEditorView.cpp:23

Scope: file

Source code excerpt:

#include "Templates/UnrealTemplate.h"

TAutoConsoleVariable<bool> CVarUseCurveCache(TEXT("CurveEditor.UseCurveCache"), true, TEXT("When true we cache curve values, when false we always regenerate."));

SCurveEditorView::SCurveEditorView()
	: bPinned(0)
	, bInteractive(1)
	, bFixedOutputBounds(0)
	, bAutoSize(1)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/CurveEditor/Private/SCurveEditorView.cpp:23

Scope: file

Source code excerpt:

#include "Templates/UnrealTemplate.h"

TAutoConsoleVariable<bool> CVarUseCurveCache(TEXT("CurveEditor.UseCurveCache"), true, TEXT("When true we cache curve values, when false we always regenerate."));

SCurveEditorView::SCurveEditorView()
	: bPinned(0)
	, bInteractive(1)
	, bFixedOutputBounds(0)
	, bAutoSize(1)

#Loc: <Workspace>/Engine/Source/Editor/CurveEditor/Private/SCurveEditorView.cpp:345

Scope (from outer to inner):

file
function     void SCurveEditorView::CheckCacheAndInvalidateIfNeeded

Source code excerpt:

		return;
	}
	const bool bUseCurveCache = CVarUseCurveCache.GetValueOnGameThread();

	if (bUseCurveCache)
	{
		//if number of curves have changed, just redo all
		if (CurveEditor->GetActiveCurvesSerialNumber() != CachedValues.CachedActiveCurvesSerialNumber)
		{