bDrawSocketsInGMode

bDrawSocketsInGMode

#Overview

name: bDrawSocketsInGMode

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 bDrawSocketsInGMode is to control the visibility of sockets in the Unreal Editor’s viewport when socket snapping is enabled in ‘G’ mode. This setting is primarily used for visualization and debugging purposes in the editor.

This setting variable is primarily used by the Unreal Editor subsystem, specifically within the UnrealEd module. It is referenced in the EditorEngine class and utilized in the LevelEditorViewport.

The value of this variable is set in the UEditorEngine class as a config property, which means it can be configured through the editor’s settings. It can also be toggled at runtime using the HandleToggleSocketGModeCommand function.

This variable interacts with the bEnableSocketSnapping flag in the editor. When socket snapping is enabled and bDrawSocketsInGMode is true, sockets will be drawn in the viewport while in ‘G’ mode.

Developers should be aware that this variable only affects the editor’s viewport rendering and does not impact the game’s runtime behavior. It’s a visualization aid for editing and should not be relied upon for gameplay logic.

Best practices when using this variable include:

  1. Use it in conjunction with socket snapping for precise placement of objects in the editor.
  2. Toggle it on when working with objects that have sockets to easily visualize their positions.
  3. Remember to turn it off when not needed to reduce visual clutter in the viewport.
  4. Consider exposing this option in a convenient place in the editor UI for easy access by level designers.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:1831, section: [/Script/UnrealEd.EditorEngine]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Editor/EditorEngine.h:509

Scope (from outer to inner):

file
class        class UEditorEngine : public UEngine

Source code excerpt:

	/** If true, then draw sockets when socket snapping is enabled in 'g' mode */
	UPROPERTY(config)
	uint32 bDrawSocketsInGMode:1;

	/** If true, then draw particle debug helpers in editor viewports */
	UPROPERTY(transient)
	uint32 bDrawParticleHelpers:1;

	/** Brush builders that have been created in the editor */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:6650

Scope (from outer to inner):

file
function     bool UEditorEngine::HandleToggleSocketGModeCommand

Source code excerpt:

bool UEditorEngine::HandleToggleSocketGModeCommand( const TCHAR* Str, FOutputDevice& Ar )
{
	bDrawSocketsInGMode = !bDrawSocketsInGMode;
	UE_LOG(LogEditorServer, Warning, TEXT("Draw sockets in 'G' mode is now %s"), bDrawSocketsInGMode ? TEXT("ENABLED") : TEXT("DISABLED"));
	return true;
}

bool UEditorEngine::HandleListMapPackageDependenciesCommand( const TCHAR* Str, FOutputDevice& Ar )
{
	ListMapPackageDependencies(Str);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp:4921

Scope (from outer to inner):

file
function     void FLevelEditorViewportClient::Draw

Source code excerpt:

	if ( GEditor->bEnableSocketSnapping )
	{
		const bool bGameViewMode = View->Family->EngineShowFlags.Game && !GEditor->bDrawSocketsInGMode;

		for( FActorIterator It(GetWorld()); It; ++It )
		{
			AActor* Actor = *It;

			if (bGameViewMode || Actor->IsHiddenEd())