BaseOpacityTextureName

BaseOpacityTextureName

#Overview

name: BaseOpacityTextureName

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 BaseOpacityTextureName is to specify the name of the base opacity texture for materials during FBX import in Unreal Engine 5. This setting variable is primarily used in the FBX import process and material creation system.

The Unreal Engine subsystems that rely on this setting variable are primarily the FBX import system and the material creation system. It is used in the DetailCustomizations and UnrealEd modules.

The value of this variable is set during the FBX import process, specifically in the FBX import UI details. It can be modified by the user through the import UI or programmatically during the import process.

This variable interacts with other texture-related variables in the FBX import process, such as BaseDiffuseTextureName, BaseEmissiveTextureName, and BaseSpecularTextureName. They are often used together to define the various texture properties of a material.

Developers must be aware that this variable is used to link the opacity texture to the created Unreal material during FBX import. It’s important to ensure that the specified texture name corresponds to an actual opacity texture in the imported FBX file or in the project’s content.

Best practices when using this variable include:

  1. Ensuring consistent naming conventions for opacity textures across your project.
  2. Verifying that the specified opacity texture exists and is correctly set up in your FBX file before import.
  3. Using this variable in conjunction with other base texture variables to create a complete material setup during import.
  4. Considering the impact on material instances and the overall material hierarchy when modifying this variable.
  5. Being mindful of performance implications when using opacity textures, especially in large scenes or on mobile platforms.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::ConstructBaseMaterialUI

Source code excerpt:


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

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

Scope (from outer to inner):

file
function     void FFbxImportUIDetails::OnOpacityTextureColor

Source code excerpt:

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

FReply FFbxImportUIDetails::MaterialBaseParamClearAllProperties()
{
	ImportUI->TextureImportData->BaseColorName.Empty();
	ImportUI->TextureImportData->BaseDiffuseTextureName.Empty();

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

Scope (from outer to inner):

file
function     FReply FFbxImportUIDetails::MaterialBaseParamClearAllProperties

Source code excerpt:

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

int32 FFbxImportUIDetails::GetMaterialImportMethodValue() const

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

Scope (from outer to inner):

file
class        class UFbxTextureImportData : public UFbxAssetImportData

Source code excerpt:


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

Scope (from outer to inner):

file
namespace    UnFbx
function     void ApplyImportUIToImportOptions

Source code excerpt:

			InOutImportOptions.BaseEmmisiveTextureName = ImportUI->TextureImportData->BaseEmmisiveTextureName;
			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

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

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 )
	{
		if (!CanImportClass(UMaterialInstanceConstant::StaticClass()))

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

Scope (from outer to inner):

file
function     UMaterialInterface* UnFbx::FFbxImporter::CreateUnrealMaterial

Source code excerpt:

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

Scope (from outer to inner):

file
namespace    UnFbx

Source code excerpt:

	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;
	bool bImportVertexAttributes;