bRealtimeMaterialViewport

bRealtimeMaterialViewport

#Overview

name: bRealtimeMaterialViewport

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bRealtimeMaterialViewport is to control real-time updates in the 3D material preview viewport within the Unreal Engine Material Editor.

This setting variable is primarily used by the Material Editor subsystem, which is part of the Unreal Engine’s editor tools. Specifically, it’s referenced in the MaterialEditor module.

The value of this variable is set in the UMaterialEditorOptions class, which is defined in the UnrealEd module. It’s a configurable property, meaning its value can be saved and loaded from configuration files.

bRealtimeMaterialViewport interacts with the PreviewViewport’s ViewportClient. When set to true, it causes the ViewportClient to enter real-time mode, allowing for continuous updates of the material preview.

Developers should be aware that enabling this option may increase editor performance overhead, especially for complex materials or on less powerful hardware. It’s a trade-off between immediate visual feedback and editor performance.

Best practices for using this variable include:

  1. Enable it when actively working on material editing to see real-time changes.
  2. Consider disabling it temporarily when working on performance-intensive materials or on less powerful machines.
  3. Use it in conjunction with other material editor settings like bRealtimeExpressionViewport for a comprehensive real-time editing experience.
  4. Remember that this setting is per-project and will affect all users of the project, so communicate any changes with your team.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:485, section: [/Script/UnrealEd.MaterialEditorOptions]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.cpp:2508

Scope (from outer to inner):

file
function     void FMaterialEditor::LoadEditorSettings

Source code excerpt:

		}

		if (EditorOptions->bRealtimeMaterialViewport && PreviewViewport->GetViewportClient())
		{
			PreviewViewport->GetViewportClient()->SetRealtime(true);
		}
	}
	
	if (EditorOptions->bHideUnrelatedNodes)

#Loc: <Workspace>/Engine/Source/Editor/MaterialEditor/Private/MaterialEditor.cpp:2535

Scope (from outer to inner):

file
function     void FMaterialEditor::SaveEditorSettings

Source code excerpt:

	{
		EditorOptions->bShowGrid					= PreviewViewport->IsTogglePreviewGridChecked();
		EditorOptions->bRealtimeMaterialViewport	= PreviewViewport->IsRealtime();
		EditorOptions->bHideUnusedConnectorsSetting	= IsOnHideConnectorsChecked();
		EditorOptions->bAlwaysRefreshAllPreviews	= IsOnAlwaysRefreshAllPreviews();
		EditorOptions->bRealtimeExpressionViewport	= IsToggleRealTimeExpressionsChecked();
		EditorOptions->bLivePreviewUpdate           = IsToggleLivePreviewChecked();
		EditorOptions->bHideUnrelatedNodes          = bHideUnrelatedNodes;
		EditorOptions->SaveConfig();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Preferences/MaterialEditorOptions.h:28

Scope (from outer to inner):

file
class        class UMaterialEditorOptions : public UObject

Source code excerpt:

	/** If true, the 3D material preview viewport updates in realtime. */
	UPROPERTY(EditAnywhere, config, Category=Options)
	uint32 bRealtimeMaterialViewport:1;

	/** If true, the linked object viewport updates in realtime. */
	UPROPERTY(EditAnywhere, config, Category=Options)
	uint32 bRealtimeExpressionViewport:1;

	/** If true, always refresh the material preview. */