GraphCreationShortcuts

GraphCreationShortcuts

#Overview

name: GraphCreationShortcuts

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of GraphCreationShortcuts is to provide a shortcut mechanism for quickly spawning specific types of Niagara nodes in the graph editor. This setting variable is part of the Niagara visual effects system in Unreal Engine 5.

GraphCreationShortcuts is primarily used by the Niagara Editor module, which is part of the Niagara plugin for Unreal Engine. This plugin is responsible for creating and editing visual effects using Niagara’s node-based system.

The value of this variable is set in the UNiagaraEditorSettings class, which inherits from UDeveloperSettings. This suggests that the variable can be configured through the project settings or editor preferences.

This variable interacts with other parts of the Niagara editor system, particularly the SNiagaraScriptGraph class, which handles the graph editing interface for Niagara scripts. It’s used in conjunction with input chord detection to determine when a shortcut should be triggered.

Developers should be aware that this variable is an array of FNiagaraSpawnShortcut structures, each likely containing an input chord (key combination) and a corresponding node type or action to perform. The system parses these shortcuts and compares them against user input to determine when to spawn a new node.

Best practices when using this variable include:

  1. Carefully choosing shortcut combinations that don’t conflict with other engine or editor shortcuts.
  2. Ensuring that the shortcuts are intuitive and easy to remember for the development team.
  3. Documenting the available shortcuts for team members to reference.
  4. Regularly reviewing and updating the shortcuts based on team feedback and workflow efficiency.
  5. Being cautious when modifying existing shortcuts, as it may disrupt established workflows.

When implementing custom node types or actions, developers should ensure they properly integrate with this shortcut system to maintain consistency in the editor experience.

#Setting Variables

#References In INI files

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Location: <Workspace>/Engine/Plugins/FX/Niagara/Config/BaseNiagara.ini:83, 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/Widgets/SNiagaraScriptGraph.cpp:393

Scope (from outer to inner):

file
function     FReply SNiagaraScriptGraph::OnSpawnGraphNodeByShortcut

Source code excerpt:

	}

	for (int32 i = 0; i < Settings->GraphCreationShortcuts.Num(); i++)
	{
		if (Settings->GraphCreationShortcuts[i].Input.GetRelationship(InChord) == FInputChord::ERelationshipType::Same)
		{
			const UEdGraphSchema_Niagara* Schema = GetDefault<UEdGraphSchema_Niagara>();

			UEdGraph* OwnerOfTemporaries = NewObject<UEdGraph>((UObject*)GetTransientPackage());
			TArray<UObject*> SelectedObjects;
			TArray<TSharedPtr<FNiagaraAction_NewNode>> Actions = Schema->GetGraphActions(Graph, nullptr, OwnerOfTemporaries);

#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/NiagaraEditor/Private/Widgets/SNiagaraScriptGraph.cpp:410

Scope (from outer to inner):

file
function     FReply SNiagaraScriptGraph::OnSpawnGraphNodeByShortcut

Source code excerpt:

				bool bCanMatch = true;
				TArray<FString> CategoryParsedTerms;
				Settings->GraphCreationShortcuts[i].Name.ParseIntoArray(CategoryParsedTerms, TEXT("::"), true);
				FString ActionDisplayName = CategoryParsedTerms.Last();

				// if we have more than one term, the shortcut has at least one category specified. In that case, we require the category chain to be identical
				if(CategoryParsedTerms.Num() > 1 && CategoryParsedTerms.Num() - 1 == NiagaraAction->Categories.Num())
				{
					for(int32 CategoryIndex = 0; CategoryIndex < CategoryParsedTerms.Num() - 1; CategoryIndex++)

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

Scope (from outer to inner):

file
class        class UNiagaraEditorSettings : public UDeveloperSettings

Source code excerpt:

	/** Shortcut key bindings that if held down while doing a mouse click, will spawn the specified type of Niagara node.*/
	UPROPERTY(config, EditAnywhere, Category = Niagara)
	TArray<FNiagaraSpawnShortcut> GraphCreationShortcuts;

	/** If true then emitter and system nodes will show a simplified representation on low zoom levels. This improves performance and readablity when zoomed out of the system overview graph. */
	UPROPERTY(config, EditAnywhere, Category = Niagara)
	bool bSimplifyStackNodesAtLowResolution = true;

	/** The max number of chars before names on the low resolution nodes are truncated. */