BaseEmissiveColorName

BaseEmissiveColorName

#Overview

name: BaseEmissiveColorName

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 BaseEmissiveColorName is to specify the name of the parameter that controls the base emissive color in materials imported from FBX files in Unreal Engine 5. This setting is primarily used in the material import system, specifically for FBX imports.

This setting variable is mainly used by the Unreal Engine’s FBX import system, which is part of the Editor module. It’s referenced in the DetailCustomizations and UnrealEd modules, which handle UI customization and editor functionality respectively.

The value of this variable is typically set through the FBX import UI, as evidenced by its presence in the FFbxImportUIDetails class. It’s stored in the UFbxTextureImportData class, which suggests it’s part of the configuration for FBX texture imports.

BaseEmissiveColorName interacts with other texture and material-related variables in the FBX import process, such as BaseEmmisiveTextureName, BaseSpecularTextureName, and others. It’s used in conjunction with these variables to set up the correct material properties during import.

Developers should be aware that this variable is used when there’s no texture in the emissive map of the imported material. It specifies which parameter in the material should be used to control the base emissive color.

Best practices when using this variable include:

  1. Ensure consistent naming conventions across your project for material parameters.
  2. Be aware that this setting affects how emissive colors are imported from FBX files, which can impact the visual fidelity of your imported assets.
  3. Consider the interaction between this setting and other texture import settings to achieve the desired material setup.
  4. When creating custom import processes or modifying the existing ones, make sure to handle this variable appropriately to maintain consistent behavior with the standard import process.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::ConstructBaseMaterialUI

Source code excerpt:

	{
		// base emissive color properties, only used when there is no texture in the emissive map
		InitialSelect = FindString(BaseColorNames, ImportUI->TextureImportData->BaseEmissiveColorName);
		InitialSelect = InitialSelect == INDEX_NONE ? 0 : InitialSelect; // default to the empty string located at index 0
		MaterialCategory.AddCustomRow(LOCTEXT("BaseEmissiveColorProperty", "Base Emissive Color Property"))
		.NameContent()
		[
			SNew(STextBlock)
			.Text(LOCTEXT("BaseEmissiveColorProperty", "Base Emissive Color Property"))

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

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::OnEmissiveColor

Source code excerpt:

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

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

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

Scope (from outer to inner):

file
function     FReply FFbxImportUIDetails::MaterialBaseParamClearAllProperties

Source code excerpt:

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

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

Scope (from outer to inner):

file
class        class UFbxTextureImportData : public UFbxAssetImportData

Source code excerpt:


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

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

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

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

Scope (from outer to inner):

file
namespace    UnFbx
function     void ApplyImportUIToImportOptions

Source code excerpt:

			InOutImportOptions.BaseSpecularTextureName = ImportUI->TextureImportData->BaseSpecularTextureName;
			InOutImportOptions.BaseOpacityTextureName = ImportUI->TextureImportData->BaseOpacityTextureName;
			InOutImportOptions.BaseEmissiveColorName = ImportUI->TextureImportData->BaseEmissiveColorName;
		}
		InOutImportOptions.bImportTextures			= ImportUI->bImportTextures;
	}

	//Some options are overlap between static mesh, skeletal mesh and anim sequence. We must set them according to the import type to set them only once
	if ( ImportUI->MeshTypeToImport == FBXIT_StaticMesh )

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

Scope (from outer to inner):

file
function     UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial

Source code excerpt:

		else
		{
			bCanInstance &= !FbxImportOptions->BaseEmissiveColorName.IsEmpty();
		}

		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);
	}

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

Scope (from outer to inner):

file
function     UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial

Source code excerpt:

					FLinearColor LinearColor((float)EmissiveColor[0], (float)EmissiveColor[1], (float)EmissiveColor[2]);
					FLinearColor CurrentLinearColor;
					if (UnrealMaterialConstant->GetVectorParameterValue(FName(*FbxImportOptions->BaseEmissiveColorName), CurrentLinearColor))
					{
						//Alpha is not consider for emissive color
						LinearColor.A = CurrentLinearColor.A;
						if (!CurrentLinearColor.Equals(LinearColor))
						{
							UnrealMaterialConstant->SetVectorParameterValueEditorOnly(FName(*FbxImportOptions->BaseEmissiveColorName), LinearColor);
						}
					}
				}
			}
			if (bOpacityTextureCreated)
			{

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

Scope (from outer to inner):

file
namespace    UnFbx

Source code excerpt:

	FString BaseColorName;
	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