bKeepFbxNamespace

bKeepFbxNamespace

#Overview

name: bKeepFbxNamespace

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 bKeepFbxNamespace is to control how FBX namespaces are handled during the import process in Unreal Engine. When enabled, this setting preserves the original FBX namespaces; when disabled, it appends the namespace to the FBX node names.

This setting variable is primarily used in the Unreal Engine’s FBX import system, which is part of the Editor module. Specifically, it’s utilized in the UnrealEd subsystem, which handles various editor-related functionalities, including asset importing.

The value of this variable is set in the UEditorPerProjectUserSettings class, which suggests that it’s a project-specific setting that can be configured by users in the editor preferences.

bKeepFbxNamespace interacts with the FBX importing process, particularly affecting how node names and material names are handled during import. It’s used in conjunction with other FBX import-related functions and variables within the FFbxImporter class.

Developers must be aware that this setting can significantly impact the naming structure of imported FBX assets. When enabled, it maintains the original namespace hierarchy, which can be useful for organizing complex assets but may result in longer names. When disabled, it flattens the namespace hierarchy, potentially simplifying asset management but losing some organizational information.

Best practices when using this variable include:

  1. Consistently using either enabled or disabled state across a project to maintain naming consistency.
  2. Communicating the chosen setting to all team members to ensure everyone understands how imported FBX assets will be named.
  3. Considering the complexity of your assets and your team’s asset management strategy when deciding whether to keep or flatten namespaces.
  4. Testing the import process with both settings to determine which better suits your project’s needs.
  5. Documenting the chosen setting and its implications in your project’s asset import guidelines.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
class        class UEditorPerProjectUserSettings : public UObject

Source code excerpt:

	/** If enabled, the fbx parser will keep the fbx namespaces, otherwise the namespace will be append to fbx node. */
	UPROPERTY(EditAnywhere, config, Category = Import)
	uint32 bKeepFbxNamespace : 1;

	/** If enabled, the fbx option dialog will show when user re-import a fbx */
	UPROPERTY(EditAnywhere, config, Category = Import)
	uint32 bShowImportDialogAtReimport : 1;

	/** Specify a project data source folder to store relative source file path to ease the re-import process*/

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMainImport.cpp:1203

Scope (from outer to inner):

file
namespace    UnFbx
function     void FFbxImporter::FixMaterialClashName

Source code excerpt:

void FFbxImporter::FixMaterialClashName()
{
	const bool bKeepNamespace = GetDefault<UEditorPerProjectUserSettings>()->bKeepFbxNamespace;

	FbxArray<FbxSurfaceMaterial*> MaterialArray;
	Scene->FillMaterialArray(MaterialArray);

	TSet<FString> AllMaterialAndTextureNames;
	TSet<FbxFileTexture*> MaterialTextures;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMainImport.cpp:1277

Scope (from outer to inner):

file
namespace    UnFbx
function     void FFbxImporter::EnsureNodeNameAreValid

Source code excerpt:

void FFbxImporter::EnsureNodeNameAreValid(const FString& BaseFilename)
{
	const bool bKeepNamespace = GetDefault<UEditorPerProjectUserSettings>()->bKeepFbxNamespace;

	TSet<FString> AllNodeName;
	int32 CurrentNameIndex = 1;
	for (int32 NodeIndex = 0; NodeIndex < Scene->GetNodeCount(); ++NodeIndex)
	{
		FbxNode* Node = Scene->GetNode(NodeIndex);