bShowGridInViewport

bShowGridInViewport

#Overview

name: bShowGridInViewport

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 bShowGridInViewport is to control the visibility of a grid in the viewport within the Niagara editor, which is part of Unreal Engine’s visual effects system.

This setting variable is primarily used by the Niagara editor, which is a plugin for Unreal Engine 5 that allows developers to create and edit particle systems and other visual effects. It’s specifically part of the NiagaraEditor module.

The value of this variable is set in the NiagaraEditorSettings class, which inherits from UDeveloperSettings. It can be modified through the SetShowGridInViewport() function, which also saves the configuration when the value changes.

This variable interacts with other viewport-related settings in the NiagaraEditorSettings class, such as bShowParticleCountsInViewport and bShowInstructionsCount. These settings collectively control various aspects of the Niagara editor’s viewport display.

Developers should be aware that this is a configuration property (marked with UPROPERTY(config)), meaning its value persists between editor sessions. Changes to this setting will affect the editor’s behavior across multiple uses.

Best practices when using this variable include:

  1. Use the provided getter (IsShowGridInViewport()) and setter (SetShowGridInViewport()) methods instead of directly accessing the variable.
  2. Consider the impact on user experience when enabling or disabling the grid, as it can affect how easily users can align and position elements in the Niagara editor.
  3. Be mindful of performance implications if frequently toggling this setting, as it may trigger viewport updates.
  4. Ensure that any custom tools or extensions that interact with the Niagara editor respect this setting to maintain consistent behavior.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Plugins/FX/Niagara/Config/BaseNiagara.ini:101, section: [/Script/NiagaraEditor.NiagaraEditorSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/NiagaraEditorSettings.cpp:308

Scope (from outer to inner):

file
function     bool UNiagaraEditorSettings::IsShowGridInViewport

Source code excerpt:

bool UNiagaraEditorSettings::IsShowGridInViewport() const
{
	return ViewportSettings.bShowGridInViewport;
}

void UNiagaraEditorSettings::SetShowGridInViewport(bool bInShowGridInViewport)
{
	if (this->ViewportSettings.bShowGridInViewport != bInShowGridInViewport)
	{
		this->ViewportSettings.bShowGridInViewport = bInShowGridInViewport;
		SaveConfig();
	}
}

bool UNiagaraEditorSettings::IsShowInstructionsCount() const
{

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Public/NiagaraEditorSettings.h:314

Scope: file

Source code excerpt:


	UPROPERTY(config)
	bool bShowGridInViewport = false;

	UPROPERTY(config)
	bool bShowInstructionsCount = false;
	
	UPROPERTY(config)
	bool bShowParticleCountsInViewport = false;

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Public/NiagaraEditorSettings.h:434

Scope (from outer to inner):

file
class        class UNiagaraEditorSettings : public UDeveloperSettings

Source code excerpt:


	NIAGARAEDITOR_API bool IsShowGridInViewport() const;
	NIAGARAEDITOR_API void SetShowGridInViewport(bool bShowGridInViewport);
	
	NIAGARAEDITOR_API bool IsShowParticleCountsInViewport() const;
	NIAGARAEDITOR_API void SetShowParticleCountsInViewport(bool bShowParticleCountsInViewport);

	NIAGARAEDITOR_API FNiagaraNamespaceMetadata GetDefaultNamespaceMetadata() const;
	NIAGARAEDITOR_API FNiagaraNamespaceMetadata GetMetaDataForNamespaces(TArray<FName> Namespaces) const;