BaseNormalTextureName

BaseNormalTextureName

#Overview

name: BaseNormalTextureName

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

#Summary

#Usage in the C++ source code

The purpose of BaseNormalTextureName is to specify the name of the base normal texture for materials during FBX import in Unreal Engine 5. This setting variable is primarily used in the material import and customization process for FBX files.

BaseNormalTextureName is utilized by the FBX import system, specifically within the DetailCustomizations and UnrealEd modules. These subsystems handle the import of FBX files and the customization of import settings in the Unreal Editor.

The value of this variable is set through the FBX import UI, where users can select or input the name of the base normal texture. It is stored in the UFbxTextureImportData class, which is part of the FBX import configuration.

BaseNormalTextureName interacts with other texture-related variables such as BaseDiffuseTextureName, BaseEmmisiveTextureName, and BaseSpecularTextureName. These variables collectively define the texture properties for imported materials.

Developers should be aware that this variable is used to link the normal map texture to the imported material. If no normal map is found, the importer may attempt to use a bump map as a fallback.

Best practices when using this variable include:

  1. Ensuring consistent naming conventions for texture files to facilitate automatic detection during import.
  2. Verifying that the specified normal texture exists and is correctly formatted for use as a normal map.
  3. Using the FBX import UI to set this value rather than modifying it directly in code, as the UI handles related settings and validations.
  4. Considering the impact on material instances and ensuring compatibility with the base material when specifying custom normal textures.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:892

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::ConstructBaseMaterialUI

Source code excerpt:


		// base normal properties
		InitialSelect = FindString(BaseTextureNames, ImportUI->TextureImportData->BaseNormalTextureName);
		InitialSelect = InitialSelect == INDEX_NONE ? 0 : InitialSelect; // default to the empty string located at index 0
		MaterialCategory.AddCustomRow(LOCTEXT("BaseNormalTextureProperty", "Base Normal Texture Property")).NameContent()
		[
			SNew(STextBlock)
			.Text(LOCTEXT("BaseNormalTextureProperty", "Base Normal Texture Property"))
			.Font(IDetailLayoutBuilder::GetDetailFont())

#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:1240

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::OnNormalTextureColor

Source code excerpt:

void FFbxImportUIDetails::OnNormalTextureColor(TSharedPtr<FString> Selection, ESelectInfo::Type SelectInfo)
{
	GetSelectionParameterString(Selection, ImportUI->TextureImportData->BaseNormalTextureName);
}

void FFbxImportUIDetails::OnEmmisiveTextureColor(TSharedPtr<FString> Selection, ESelectInfo::Type SelectInfo)
{
	GetSelectionParameterString(Selection, ImportUI->TextureImportData->BaseEmmisiveTextureName);
}

#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:1267

Scope (from outer to inner):

file
function     FReply FFbxImportUIDetails::MaterialBaseParamClearAllProperties

Source code excerpt:

	ImportUI->TextureImportData->BaseColorName.Empty();
	ImportUI->TextureImportData->BaseDiffuseTextureName.Empty();
	ImportUI->TextureImportData->BaseNormalTextureName.Empty();
	ImportUI->TextureImportData->BaseEmmisiveTextureName.Empty();
	ImportUI->TextureImportData->BaseEmissiveColorName.Empty();
	ImportUI->TextureImportData->BaseSpecularTextureName.Empty();
	ImportUI->TextureImportData->BaseOpacityTextureName.Empty();
	//Need to refresh the custom detail since we do not have any pointer on the combo box
	RefreshCustomDetail();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Factories/FbxTextureImportData.h:39

Scope (from outer to inner):

file
class        class UFbxTextureImportData : public UFbxAssetImportData

Source code excerpt:


	UPROPERTY(BlueprintReadWrite, config, Category = Material, meta = (ImportType = "Mesh"))
	FString BaseNormalTextureName;

	UPROPERTY(BlueprintReadWrite, config, Category = Material, meta = (ImportType = "Mesh"))
	FString BaseEmissiveColorName;

	UPROPERTY(BlueprintReadWrite, config, Category = Material, meta = (ImportType = "Mesh"))
	FString BaseEmmisiveTextureName;

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

Scope (from outer to inner):

file
namespace    UnFbx
function     void ApplyImportUIToImportOptions

Source code excerpt:

			InOutImportOptions.BaseColorName		= ImportUI->TextureImportData->BaseColorName;
			InOutImportOptions.BaseDiffuseTextureName = ImportUI->TextureImportData->BaseDiffuseTextureName;
			InOutImportOptions.BaseNormalTextureName = ImportUI->TextureImportData->BaseNormalTextureName;
			InOutImportOptions.BaseEmmisiveTextureName = ImportUI->TextureImportData->BaseEmmisiveTextureName;
			InOutImportOptions.BaseSpecularTextureName = ImportUI->TextureImportData->BaseSpecularTextureName;
			InOutImportOptions.BaseOpacityTextureName = ImportUI->TextureImportData->BaseOpacityTextureName;
			InOutImportOptions.BaseEmissiveColorName = ImportUI->TextureImportData->BaseEmissiveColorName;
		}
		InOutImportOptions.bImportTextures			= ImportUI->bImportTextures;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMaterialImport.cpp:656

Scope (from outer to inner):

file
function     UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial

Source code excerpt:


		bCanInstance &= CanUseMaterialWithInstance(FbxMaterial, FbxSurfaceMaterial::sSpecular, FbxImportOptions->BaseSpecularTextureName, FbxImportOptions->BaseMaterial, OutUVSets);
		bCanInstance &= CanUseMaterialWithInstance(FbxMaterial, FbxSurfaceMaterial::sNormalMap, FbxImportOptions->BaseNormalTextureName, FbxImportOptions->BaseMaterial, OutUVSets);
		bCanInstance &= CanUseMaterialWithInstance(FbxMaterial, FbxSurfaceMaterial::sTransparentColor, FbxImportOptions->BaseOpacityTextureName, FbxImportOptions->BaseMaterial, OutUVSets);
	}

	//Make sure we can import the material class
	if ( bCanInstance )
	{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMaterialImport.cpp:705

Scope (from outer to inner):

file
function     UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial

Source code excerpt:

			bool bOpacityTextureCreated = LinkMaterialProperty(FbxMaterial, UnrealMaterialConstant, FbxSurfaceMaterial::sTransparentColor, FName(*FbxImportOptions->BaseOpacityTextureName), false);
			LinkMaterialProperty(FbxMaterial, UnrealMaterialConstant, FbxSurfaceMaterial::sSpecular, FName(*FbxImportOptions->BaseSpecularTextureName), false);
			if (!LinkMaterialProperty(FbxMaterial, UnrealMaterialConstant, FbxSurfaceMaterial::sNormalMap, FName(*FbxImportOptions->BaseNormalTextureName), true))
			{
				LinkMaterialProperty(FbxMaterial, UnrealMaterialConstant, FbxSurfaceMaterial::sBump, FName(*FbxImportOptions->BaseNormalTextureName), true); // no bump in unreal, use as normal map
			}

			// If we only have colors and its different from the base material
			if (!bDiffuseTextureCreated)
			{
				FbxDouble3 DiffuseColor;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Public/FbxImporter.h:166

Scope (from outer to inner):

file
namespace    UnFbx

Source code excerpt:

	FString BaseDiffuseTextureName;
	FString BaseEmissiveColorName;
	FString BaseNormalTextureName;
	FString BaseEmmisiveTextureName;
	FString BaseSpecularTextureName;
	FString BaseOpacityTextureName;
	EMaterialSearchLocation MaterialSearchLocation;
	//If true the materials will be reorder to follow the fbx order
	bool bReorderMaterialToFbxOrder;