BaseSpecularTextureName

BaseSpecularTextureName

#Overview

name: BaseSpecularTextureName

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 BaseSpecularTextureName is to define the name of the base specular texture property for materials when importing FBX files into Unreal Engine 5. This variable is primarily used in the material import and customization process for FBX assets.

The Unreal Engine subsystems that rely on this setting variable are primarily the FBX import system and the material customization system. Specifically, it’s used in the DetailCustomizations module and the UnrealEd module.

The value of this variable is typically set during the FBX import process. It can be set through the FBX import UI, which is customized in the FFbxImportUIDetails class.

This variable interacts with other texture-related variables in the FBX import process, such as BaseNormalTextureName, BaseEmmisiveTextureName, and BaseOpacityTextureName. Together, these variables define the names of various texture properties for imported materials.

Developers should be aware that this variable is part of the UFbxTextureImportData class, which is derived from UFbxAssetImportData. It’s used to specify the name of the specular texture property when creating or modifying materials during FBX import.

Best practices when using this variable include:

  1. Ensure consistent naming conventions for texture properties across your project.
  2. Be aware that changing this value will affect how specular textures are mapped during FBX import.
  3. Consider the interaction with other texture property names to maintain consistency in your material setup.
  4. Use the FBX import UI to set this value rather than modifying it directly in code, unless you have specific requirements.
  5. Remember that this setting affects the creation of material instances from imported FBX materials, so it should be used in conjunction with your overall material strategy.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:705, 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:981

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::ConstructBaseMaterialUI

Source code excerpt:


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

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

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::OnSpecularTextureColor

Source code excerpt:

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

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

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

Scope (from outer to inner):

file
function     FReply FFbxImportUIDetails::MaterialBaseParamClearAllProperties

Source code excerpt:

	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();
	return FReply::Handled();
}

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

Scope (from outer to inner):

file
class        class UFbxTextureImportData : public UFbxAssetImportData

Source code excerpt:


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

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

	UNREALED_API bool CanEditChange( const FProperty* InProperty ) const override;
};

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

Scope (from outer to inner):

file
namespace    UnFbx
function     void ApplyImportUIToImportOptions

Source code excerpt:

			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:655

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:704

Scope (from outer to inner):

file
function     UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial

Source code excerpt:

			bool bEmissiveTextureCreated = LinkMaterialProperty(FbxMaterial, UnrealMaterialConstant, FbxSurfaceMaterial::sEmissive, FName(*FbxImportOptions->BaseEmmisiveTextureName), false);
			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

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

Scope (from outer to inner):

file
namespace    UnFbx

Source code excerpt:

	FString BaseNormalTextureName;
	FString BaseEmmisiveTextureName;
	FString BaseSpecularTextureName;
	FString BaseOpacityTextureName;
	EMaterialSearchLocation MaterialSearchLocation;
	//If true the materials will be reorder to follow the fbx order
	bool bReorderMaterialToFbxOrder;
	// Skeletal Mesh options
	bool bImportMorph;