bSCSEditorShowGrid

bSCSEditorShowGrid

#Overview

name: bSCSEditorShowGrid

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 bSCSEditorShowGrid is to control the visibility of the grid in the Scene Component Editor (SCS Editor) viewport within the Unreal Engine editor. This setting is part of the editor’s user interface and visualization system.

This setting variable is primarily used by the Kismet module, specifically within the SCS Editor viewport client. It’s part of the editor’s user settings, which allows individual developers to customize their editing environment.

The value of this variable is set in the UEditorPerProjectUserSettings class, which is a configuration class for editor settings that can be different for each project. It’s marked with the UPROPERTY(config) macro, indicating that it’s saved in the project’s configuration files.

This variable interacts with the DrawHelper.bDrawGrid property in the FSCSEditorViewportClient class. When the setting changes, it directly affects whether the grid is drawn in the viewport.

Developers should be aware that:

  1. This is a per-project setting, not a global engine setting.
  2. Changes to this setting will immediately affect the SCS Editor viewport’s appearance.
  3. The setting can be toggled at runtime through the ToggleShowGrid() function.

Best practices when using this variable include:

  1. Respecting user preferences and not overriding this setting without user consent.
  2. If modifying this setting programmatically, consider providing a user interface option to allow easy toggling.
  3. Be aware that changing this setting might affect user workflow, so changes should be made thoughtfully.
  4. When developing tools or plugins that interact with the SCS Editor viewport, check this setting to ensure consistent behavior with the grid visibility.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SCSEditorViewportClient.cpp:179

Scope (from outer to inner):

file
function     FSCSEditorViewportClient::FSCSEditorViewportClient

Source code excerpt:


	// Set if the grid will be drawn
	DrawHelper.bDrawGrid = GetDefault<UEditorPerProjectUserSettings>()->bSCSEditorShowGrid;

	// now add floor
	EditorFloorComp = NewObject<UStaticMeshComponent>(GetTransientPackage(), TEXT("EditorFloorComp"));

	UStaticMesh* FloorMesh = LoadObject<UStaticMesh>(NULL, TEXT("/Engine/EditorMeshes/PhAT_FloorBox.PhAT_FloorBox"), NULL, LOAD_None, NULL);
	if (ensure(FloorMesh))

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/SCSEditorViewportClient.cpp:1091

Scope (from outer to inner):

file
function     bool FSCSEditorViewportClient::GetShowGrid

Source code excerpt:

bool FSCSEditorViewportClient::GetShowGrid() 
{
	return GetDefault<UEditorPerProjectUserSettings>()->bSCSEditorShowGrid;
}

void FSCSEditorViewportClient::ToggleShowGrid() 
{
	UEditorPerProjectUserSettings* Settings = GetMutableDefault<UEditorPerProjectUserSettings>();

	bool bShowGrid = Settings->bSCSEditorShowGrid;
	bShowGrid = !bShowGrid;

	DrawHelper.bDrawGrid = bShowGrid;

	Settings->bSCSEditorShowGrid = bShowGrid;
	Settings->PostEditChange();
	
	Invalidate();
}

void FSCSEditorViewportClient::BeginTransaction(const FText& Description)

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Editor/EditorPerProjectUserSettings.h:104

Scope (from outer to inner):

file
class        class UEditorPerProjectUserSettings : public UObject

Source code excerpt:


	UPROPERTY(config)
	bool bSCSEditorShowGrid;

	UPROPERTY(config)
	bool bSCSEditorShowFloor;

	/** If enabled, the Editor will attempt to get the users attention whenever a UAT task (such as cooking or packaging) is completed */
	UPROPERTY(EditAnywhere, config, Category = UnrealAutomationTool)