bAllowSelectTranslucent

bAllowSelectTranslucent

#Overview

name: bAllowSelectTranslucent

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

#Summary

#Usage in the C++ source code

The purpose of bAllowSelectTranslucent is to control whether translucent objects can be selected in the Unreal Engine editor’s perspective viewports. This setting is primarily used in the editor’s selection and rendering systems.

This setting variable is relied upon by several Unreal Engine subsystems and plugins:

  1. The Control Rig Editor plugin
  2. The Movie Pipeline Mask Render Pass plugin
  3. The Level Editor module
  4. The UnrealEd module

The value of this variable is set in the UEditorPerProjectUserSettings class, which is a configuration class for editor-specific settings. It can be toggled through the Level Editor actions and is also modified programmatically in certain scenarios.

This variable interacts with other parts of the engine, particularly:

Developers should be aware of the following when using this variable:

  1. Changing this setting affects the ability to select translucent objects in the editor viewports.
  2. It can impact performance and visual feedback in the editor, especially when working with scenes that have many translucent objects.
  3. The setting is project-specific and persists between editor sessions.

Best practices when using this variable include:

  1. Consider the needs of your project carefully before changing this setting, as it can affect workflow and performance.
  2. Be consistent in its usage across your development team to avoid confusion.
  3. When programmatically changing this value, ensure to restore it to its previous state after use, as demonstrated in the Movie Pipeline Object ID Pass.
  4. Be aware that this setting may need to be adjusted when working with specific tools or plugins that rely on translucent object selection.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/EditMode/ControlRigEditMode.cpp:3897

Scope (from outer to inner):

file
function     void FControlRigEditMode::CreateShapeActors

Source code excerpt:

	{
		// enable translucent selection
		GetMutableDefault<UEditorPerProjectUserSettings>()->bAllowSelectTranslucent = true;
	}

	TArray<FRigControlElement*> Controls = ControlRig->AvailableControls();
	const TArray<TSoftObjectPtr<UControlRigShapeLibrary>> ShapeLibraries = ControlRig->GetShapeLibraries();
	int32 ControlRigIndex = RuntimeControlRigs.Find(ControlRig);
	for (FRigControlElement* ControlElement : Controls)

#Loc: <Workspace>/Engine/Plugins/MovieScene/MoviePipelineMaskRenderPass/Source/MoviePipelineMaskRenderPass/Private/MoviePipelineObjectIdPass.cpp:184

Scope (from outer to inner):

file
function     void UMoviePipelineObjectIdRenderPass::SetupImpl

Source code excerpt:

#if WITH_EDITOR
	UEditorPerProjectUserSettings* EditorSettings = GetMutableDefault<UEditorPerProjectUserSettings>();
	bPrevAllowSelectTranslucent = EditorSettings->bAllowSelectTranslucent;
	EditorSettings->bAllowSelectTranslucent = bIncludeTranslucentObjects;
#endif
}

void UMoviePipelineObjectIdRenderPass::TeardownImpl()
{
	ManifestAnnotation.RemoveAnnotation(this);

#Loc: <Workspace>/Engine/Plugins/MovieScene/MoviePipelineMaskRenderPass/Source/MoviePipelineMaskRenderPass/Private/MoviePipelineObjectIdPass.cpp:195

Scope (from outer to inner):

file
function     void UMoviePipelineObjectIdRenderPass::TeardownImpl

Source code excerpt:

#if WITH_EDITOR
	UEditorPerProjectUserSettings* EditorSettings = GetMutableDefault<UEditorPerProjectUserSettings>();
	EditorSettings->bAllowSelectTranslucent = bPrevAllowSelectTranslucent;
#endif

	// Preserve our view state until the rendering thread has been flushed.
	Super::TeardownImpl();
}

#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:2710

Scope (from outer to inner):

file
function     void FLevelEditorActionCallbacks::OnAllowTranslucentSelection

Source code excerpt:


	// Toggle 'allow select translucent'
	Settings->bAllowSelectTranslucent = !Settings->bAllowSelectTranslucent;
	Settings->PostEditChange();

	// Need to refresh hit proxies as we changed what should be rendered into them
	GUnrealEd->RedrawAllViewports();
}

bool FLevelEditorActionCallbacks::OnIsAllowTranslucentSelectionEnabled()
{
	return GetDefault<UEditorPerProjectUserSettings>()->bAllowSelectTranslucent == true;
}

void FLevelEditorActionCallbacks::OnAllowGroupSelection()
{
	AGroupActor::ToggleGroupMode();
}

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

Scope (from outer to inner):

file
class        class UEditorPerProjectUserSettings : public UObject

Source code excerpt:

	/** True if user should be allowed to select translucent objects in perspective viewports */
	UPROPERTY(config)
	uint32 bAllowSelectTranslucent:1;

	/** If this is true, all of an actors' components will be drawn when the actor or one of its component is selected */
	UPROPERTY(config)
	uint32 bShowSelectionSubcomponents:1;

	UPROPERTY()

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Editor/ActorPositioning.cpp:139

Scope (from outer to inner):

file
function     bool IsHitIgnoredRenderingThread

Source code excerpt:

		// BSP is a bit special in that its bDrawRelevance is false even when drawn as wireframe because InSceneView.Family->EngineShowFlags.BSPTriangles is off
		const bool bIsRenderedOnScreen = ViewRelevance.bDrawRelevance || (PrimitiveComponent->IsA(UModelComponent::StaticClass()) && InSceneView.Family->EngineShowFlags.BSP);
		const bool bIgnoreTranslucentPrimitive = ViewRelevance.HasTranslucency() && !GetDefault<UEditorPerProjectUserSettings>()->bAllowSelectTranslucent;
		
		return (!bIsRenderedOnScreen && !bConsiderInvisibleComponentForPlacement) || bIgnoreTranslucentPrimitive;
	}

	return false;
}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/UnrealEdEngine.cpp:965

Scope (from outer to inner):

file
function     bool UUnrealEdEngine::AllowSelectTranslucent

Source code excerpt:

bool UUnrealEdEngine::AllowSelectTranslucent() const
{
	return GetDefault<UEditorPerProjectUserSettings>()->bAllowSelectTranslucent;
}


bool UUnrealEdEngine::OnlyLoadEditorVisibleLevelsInPIE() const
{
	return GetDefault<ULevelEditorPlaySettings>()->bOnlyLoadVisibleLevelsInPIE;