BaseDiffuseTextureName
BaseDiffuseTextureName
#Overview
name: BaseDiffuseTextureName
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 BaseDiffuseTextureName is to store the name of the base diffuse texture for materials being imported from FBX files into Unreal Engine.
This setting variable is primarily used in the FBX import process and is part of the material import system in Unreal Engine. It is referenced in several modules related to FBX import and material creation, including:
- DetailCustomizations module
- UnrealEd module
The value of this variable is typically set during the FBX import process, either through user input in the import UI or programmatically during the import operation. It is stored as a property of the UFbxTextureImportData class.
BaseDiffuseTextureName interacts with other texture-related variables such as BaseNormalTextureName, BaseEmissiveTextureName, and BaseSpecularTextureName. These variables collectively define the textures used in creating materials from imported FBX files.
Developers should be aware that:
- This variable is used to link the diffuse texture property of the imported FBX material to the corresponding Unreal material.
- It plays a crucial role in determining whether a material can be instanced during import.
- The value of this variable can be cleared using the MaterialBaseParamClearAllProperties function.
Best practices when using this variable include:
- Ensure that the texture name specified matches the naming convention used in your project for consistency.
- Be mindful of the impact on material instancing when setting this variable.
- Consider using this variable in conjunction with other base texture name variables to create a complete material setup during FBX import.
- When customizing the FBX import process, make sure to properly set and handle this variable to ensure correct material creation.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:701, section: [/Script/UnrealEd.FbxTextureImportData]
- INI Section:
/Script/UnrealEd.FbxTextureImportData
- Raw value:
""
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:865
Scope (from outer to inner):
file
function void FFbxImportUIDetails::ConstructBaseMaterialUI
Source code excerpt:
if(BaseTextureNames.Num() > 1)
{
InitialSelect = FindString(BaseTextureNames, ImportUI->TextureImportData->BaseDiffuseTextureName);
InitialSelect = InitialSelect == INDEX_NONE ? 0 : InitialSelect; // default to the empty string located at index 0
MaterialCategory.AddCustomRow(LOCTEXT("BaseTextureProperty", "Base Texture Property")).NameContent()
[
SNew(STextBlock)
.Text(LOCTEXT("BaseTextureProperty", "Base Texture Property"))
.Font(IDetailLayoutBuilder::GetDetailFont())
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:1235
Scope (from outer to inner):
file
function void FFbxImportUIDetails::OnDiffuseTextureColor
Source code excerpt:
void FFbxImportUIDetails::OnDiffuseTextureColor(TSharedPtr<FString> Selection, ESelectInfo::Type SelectInfo)
{
GetSelectionParameterString(Selection, ImportUI->TextureImportData->BaseDiffuseTextureName);
}
void FFbxImportUIDetails::OnNormalTextureColor(TSharedPtr<FString> Selection, ESelectInfo::Type SelectInfo)
{
GetSelectionParameterString(Selection, ImportUI->TextureImportData->BaseNormalTextureName);
}
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:1266
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
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Factories/FbxTextureImportData.h:36
Scope (from outer to inner):
file
class class UFbxTextureImportData : public UFbxAssetImportData
Source code excerpt:
UPROPERTY(BlueprintReadWrite, config, Category = Material, meta = (ImportType = "Mesh"))
FString BaseDiffuseTextureName;
UPROPERTY(BlueprintReadWrite, config, Category = Material, meta = (ImportType = "Mesh"))
FString BaseNormalTextureName;
UPROPERTY(BlueprintReadWrite, config, Category = Material, meta = (ImportType = "Mesh"))
FString BaseEmissiveColorName;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMainImport.cpp:392
Scope (from outer to inner):
file
namespace UnFbx
function void ApplyImportUIToImportOptions
Source code excerpt:
InOutImportOptions.BaseMaterial = BaseMaterialInterface;
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;
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMaterialImport.cpp:638
Scope (from outer to inner):
file
function UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial
Source code excerpt:
if (FbxDiffuseProperty.IsValid())
{
bCanInstance = CanUseMaterialWithInstance(FbxMaterial, FbxSurfaceMaterial::sDiffuse, FbxImportOptions->BaseDiffuseTextureName, FbxImportOptions->BaseMaterial, OutUVSets);
}
else
{
bCanInstance = !FbxImportOptions->BaseColorName.IsEmpty();
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMaterialImport.cpp:701
Scope (from outer to inner):
file
function UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial
Source code excerpt:
// textures and properties
bool bDiffuseTextureCreated = LinkMaterialProperty(FbxMaterial, UnrealMaterialConstant, FbxSurfaceMaterial::sDiffuse, FName(*FbxImportOptions->BaseDiffuseTextureName), false);
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
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Public/FbxImporter.h:164
Scope (from outer to inner):
file
namespace UnFbx
Source code excerpt:
class UMaterialInterface *BaseMaterial;
FString BaseColorName;
FString BaseDiffuseTextureName;
FString BaseEmissiveColorName;
FString BaseNormalTextureName;
FString BaseEmmisiveTextureName;
FString BaseSpecularTextureName;
FString BaseOpacityTextureName;
EMaterialSearchLocation MaterialSearchLocation;