bImportTextures

bImportTextures

#Overview

name: bImportTextures

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

#Summary

#Usage in the C++ source code

The purpose of bImportTextures is to control whether textures should be imported during the asset import process in Unreal Engine 5. This setting variable is primarily used in the context of importing 3D models, materials, and scenes from external file formats such as FBX.

Key points about bImportTextures:

  1. Subsystems and modules: This variable is used in various Unreal Engine subsystems, including the Interchange system, DMX Engine, and the FBX importer. It’s primarily utilized in the Editor and UnrealEd modules.

  2. Setting the value: The value of bImportTextures is typically set through import UI options or programmatically when configuring import settings. It can be found in classes like UFbxImportUI, UDMXGDTFImportUI, and UInterchangeGenericTexturePipeline.

  3. Interaction with other variables: bImportTextures often interacts with other import-related variables, such as bImportMaterials. In some cases, bImportTextures is disabled when bImportMaterials is true, as textures are always imported when importing materials.

  4. Special considerations:

    • When reimporting assets, bImportTextures is often set to false to prevent overwriting existing textures.
    • In some pipelines, like the InterchangeGenericAssetsPipeline, bImportTextures might be set to false for specific import contexts.
  5. Best practices:

    • Consider the impact on performance and disk space when enabling texture import, especially for large projects.
    • When reimporting assets, carefully evaluate whether you need to reimport textures or keep existing ones.
    • Be aware of the relationship between material and texture import settings to ensure consistent results.

Developers should be aware that changing this variable can significantly affect the import process, potentially impacting project size, import time, and the overall structure of imported assets. It’s essential to use this setting in conjunction with other import options to achieve the desired result for your specific use case.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Interchange/Editor/Source/InterchangeEditor/Private/InterchangeFbxAssetImportDataConverter.cpp:654

Scope (from outer to inner):

file
namespace    UE::Interchange::Private
function     UAssetImportData* ConvertToInterchange

Source code excerpt:


		//Texture Options
		GenericAssetPipeline->MaterialPipeline->TexturePipeline->bImportTextures = FbxImportUI->bImportTextures;
		GenericAssetPipeline->MaterialPipeline->TexturePipeline->bFlipNormalMapGreenChannel = FbxImportUI->TextureImportData->bInvertNormalMaps;

		//Default the force animation to false
		GenericAssetPipeline->CommonSkeletalMeshesAndAnimationsProperties->bImportOnlyAnimations = false;

		//Discover if we must import something in particular

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Pipelines/Private/InterchangeGenericAssetsPipeline.cpp:1091

Scope (from outer to inner):

file
function     void UInterchangeGenericAssetsPipeline::ExecutePipeline

Source code excerpt:

		MeshPipeline->bCreatePhysicsAsset = false;
		MeshPipeline->PhysicsAsset = nullptr;
		MaterialPipeline->TexturePipeline->bImportTextures = false;
	}

	//////////////////////////////////////////////////////////////////////////


	//Setup the Global import offset

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Pipelines/Private/InterchangeGenericTexturePipeline.cpp:122

Scope (from outer to inner):

file
function     void UInterchangeGenericTexturePipeline::AdjustSettingsForContext

Source code excerpt:

		|| ImportType == EInterchangePipelineContext::AssetAlternateSkinningReimport)
	{
		bImportTextures = false;
		HideCategories.Add(TEXT("Textures"));
	}
	if (UInterchangePipelineBase* OuterMostPipeline = GetMostPipelineOuter())
	{
		for (const FString& HideCategoryName : HideCategories)
		{

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Pipelines/Private/InterchangeGenericTexturePipeline.cpp:187

Scope (from outer to inner):

file
function     void UInterchangeGenericTexturePipeline::ExecutePipeline

Source code excerpt:

	});

	if (bImportTextures)
	{
		UInterchangeTextureFactoryNode* TextureFactoryNode = nullptr;
		for (UInterchangeTextureNode* TextureNode : TextureNodes)
		{
			TextureFactoryNode = HandleCreationOfTextureFactoryNode(TextureNode);
		}

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Pipelines/Public/InterchangeGenericTexturePipeline.h:25

Scope (from outer to inner):

file
class        class UInterchangeGenericTexturePipeline : public UInterchangePipelineBase

Source code excerpt:

	/** If enabled, imports all texture assets found in the source. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Textures")
	bool bImportTextures = true;

	/** If set, and there is only one asset and one source, the imported asset will be given this name. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Textures", meta=(StandAlonePipelineProperty = "True", AlwaysResetToDefault = "True"))
	FString AssetName;

#if WITH_EDITORONLY_DATA

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXEngine/Source/DMXEditor/Private/Factories/DMXGDTFFactory.cpp:22

Scope (from outer to inner):

file
function     UDMXGDTFImportUI::UDMXGDTFImportUI

Source code excerpt:

    : bUseSubDirectory(false)
    , bImportXML(true)
    , bImportTextures(false)
    , bImportModels(false)
{
}

void UDMXGDTFImportUI::ResetToDefault()
{
    bUseSubDirectory = false;
    bImportXML = true;
    bImportTextures = false;
    bImportModels = false;
}

UDMXGDTFFactory::UDMXGDTFFactory()
{
    SupportedClass = nullptr;

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXEngine/Source/DMXEditor/Private/Factories/DMXGDTFFactory.cpp:138

Scope (from outer to inner):

file
function     UObject* UDMXGDTFFactory::FactoryCreateFile

Source code excerpt:

    }

    if (!ImportUI->bImportXML && !ImportUI->bImportModels && !ImportUI->bImportTextures)
    {
        Warn->Log(ELogVerbosity::Error, TEXT("Nothing to Import") );
		return nullptr;
    }

    // Try to load and parse the content

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXEngine/Source/DMXEditor/Private/Factories/DMXGDTFImportUI.h:26

Scope (from outer to inner):

file
class        class UDMXGDTFImportUI : public UObject

Source code excerpt:


    UPROPERTY(EditAnywhere, Category = "DMX")
    bool bImportTextures;

    UPROPERTY(EditAnywhere, Category = "DMX")
    bool bImportModels;
};

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Factories/FbxImportUI.h:191

Scope (from outer to inner):

file
class        class UFbxImportUI : public UObject, public IImportSettingsParser

Source code excerpt:

	/** Whether or not we should import textures. This option is disabled when we are importing materials because textures are always imported in that case. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, config, Category=Material, meta = (ImportType = "GeoOnly", EditCondition="!bImportMaterials"))
	uint32 bImportTextures:1;

	/** If true, the imported material sections will automatically be reset to the imported data in case of a reimport conflict. */
	UPROPERTY(BlueprintReadWrite, Transient, Category = Material)
	uint32 bResetToFbxOnMaterialConflict:1;

	/** Import data used when importing static meshes */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Factories/EditorFactories.cpp:6740

Scope (from outer to inner):

file
function     EReimportResult::Type UReimportFbxSkeletalMeshFactory::Reimport

Source code excerpt:

			{
				ImportOptions->bImportMaterials = false;
				ImportOptions->bImportTextures = false;
				ImportOptions->bImportLOD = false;
				ImportOptions->bImportSkeletalMeshLODs = false;
				ImportOptions->bImportAnimations = false;
				ImportOptions->bImportMorph = false;
				ImportOptions->VertexColorImportOption = EVertexColorImportOption::Ignore;
			}

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

Scope (from outer to inner):

file
function     UObject* UFbxFactory::FactoryCreateFile

Source code excerpt:

			{
				ImportOptions->bImportMaterials = false;
				ImportOptions->bImportTextures = false;
				ImportOptions->bImportLOD = false;
				ImportOptions->bImportSkeletalMeshLODs = false;
				ImportOptions->bImportAnimations = false;
				ImportOptions->bImportMorph = false;
			}
			else if (ImportOptions->bImportAsSkeletalGeometry)

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxFactory.cpp:817

Scope: file

Source code excerpt:

								uint32 bImportMaterials = ImportOptions->bImportMaterials;
								ImportOptions->bImportMaterials = 0;
								uint32 bImportTextures = ImportOptions->bImportTextures;
								ImportOptions->bImportTextures = 0;

								FbxImporter->ImportFbxMorphTarget(SkelMeshNodeArray, BaseSkeletalMesh, ImportedSuccessfulLodIndex, OutData, bMapMorphTargetToTimeZero);
								bOperationCanceled |= FbxImporter->GetImportOperationCancelled();
							
								ImportOptions->bImportMaterials = !!bImportMaterials;
								ImportOptions->bImportTextures = !!bImportTextures;
							}

							bOperationCanceled |= SlowTask.ShouldCancel();
						}
					
						if (BaseSkeletalMesh && !bOperationCanceled)

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

Scope (from outer to inner):

file
namespace    UnFbx
function     void ApplyImportUIToImportOptions

Source code excerpt:

			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 )
	{
		UFbxStaticMeshImportData* StaticMeshData	= ImportUI->StaticMeshImportData;

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

Scope (from outer to inner):

file
namespace    UnFbx
function     bool FFbxImporter::ImportFromFile

Source code excerpt:

						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt ForceFrontXAxis"), ImportOptions->bForceFrontXAxis));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt ImportMaterials"), ImportOptions->bImportMaterials));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt ImportTextures"), ImportOptions->bImportTextures));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt InvertNormalMap"), ImportOptions->bInvertNormalMap));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt RemoveNameSpace"), ImportOptions->bRemoveNameSpace));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt UsedAsFullName"), ImportOptions->bUsedAsFullName));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt ImportTranslation"), ImportOptions->ImportTranslation.ToString()));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt ImportRotation"), ImportOptions->ImportRotation.ToString()));
						Attribs.Add(FAnalyticsEventAttribute(TEXT("GenOpt ImportUniformScale"), ImportOptions->ImportUniformScale));

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSceneImportData.cpp:41

Scope (from outer to inner):

file
function     UnFbx::FBXImportOptions *JSONToFbxOption

Source code excerpt:

	OptionObj->TryGetBoolField(TEXT("bImportMaterials"), Option->bImportMaterials);
	OptionObj->TryGetBoolField(TEXT("bInvertNormalMap"), Option->bInvertNormalMap);
	OptionObj->TryGetBoolField(TEXT("bImportTextures"), Option->bImportTextures);
	OptionObj->TryGetBoolField(TEXT("bImportLOD"), Option->bImportLOD);
	OptionObj->TryGetBoolField(TEXT("bUsedAsFullName"), Option->bUsedAsFullName);
	OptionObj->TryGetBoolField(TEXT("bConvertScene"), Option->bConvertScene);
	OptionObj->TryGetBoolField(TEXT("bForceFrontXAxis"), Option->bForceFrontXAxis);
	OptionObj->TryGetBoolField(TEXT("bConvertSceneUnit"), Option->bConvertSceneUnit);
	OptionObj->TryGetBoolField(TEXT("bRemoveNameSpace"), Option->bRemoveNameSpace);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSceneImportData.cpp:163

Scope (from outer to inner):

file
function     FString FbxOptionToJSON

Source code excerpt:

		Option->bImportMaterials ? 1 : 0,
		Option->bInvertNormalMap ? 1 : 0,
		Option->bImportTextures ? 1 : 0,
		Option->bImportLOD ? 1 : 0,
		Option->bUsedAsFullName ? 1 : 0,
		Option->bConvertScene ? 1 : 0,
		Option->bForceFrontXAxis ? 1 : 0,
		Option->bConvertSceneUnit ? 1 : 0,
		Option->bRemoveNameSpace ? 1 : 0

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSceneImportFactory.cpp:120

Scope (from outer to inner):

file
function     bool GetFbxSceneImportOptions

Source code excerpt:

	GlobalImportSettings->bUsedAsFullName = true;
	//Make sure we import the textures
	GlobalImportSettings->bImportTextures = true;
	//Make sure Material get imported
	GlobalImportSettings->bImportMaterials = true;
	//Make sure skeletal mesh sections with the same material are combined (and not kept separate)
	GlobalImportSettings->bKeepSectionsSeparate = false;
	//TODO support T0AsRefPose
	GlobalImportSettings->bUseT0AsRefPose = false;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSkeletalMeshImport.cpp:2424

Scope (from outer to inner):

file
function     USkeletalMesh* UnFbx::FFbxImporter::ReimportSkeletalMesh

Source code excerpt:

	bool Old_ImportRigidMesh = ImportOptions->bImportRigidMesh;
	bool Old_ImportMaterials = ImportOptions->bImportMaterials;
	bool Old_ImportTextures = ImportOptions->bImportTextures;
	bool Old_ImportAnimations = ImportOptions->bImportAnimations;

	auto CleanUpImportOptionsData = [&]()
	{
		ImportOptions->bImportRigidMesh = Old_ImportRigidMesh;
		ImportOptions->bImportMaterials = Old_ImportMaterials;
		ImportOptions->bImportTextures = Old_ImportTextures;
		ImportOptions->bImportAnimations = Old_ImportAnimations;
	};

	// support to update rigid animation mesh
	ImportOptions->bImportRigidMesh = true;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSkeletalMeshImport.cpp:2577

Scope (from outer to inner):

file
function     USkeletalMesh* UnFbx::FFbxImporter::ReimportSkeletalMesh

Source code excerpt:

		{
			ImportOptions->bImportMaterials = false;
			ImportOptions->bImportTextures = false;
		}
		//In case of a scene reimport animations are reimport later so its ok to hardcode animation to false here
		ImportOptions->bImportAnimations = false;
		// check if there is LODGroup for this skeletal mesh
		int32 MaxLODLevel = 1;
		int32 NumPrevLODs = Mesh->GetLODNum();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSkeletalMeshImport.cpp:3204

Scope (from outer to inner):

file
function     bool UnFbx::FFbxImporter::FillSkelMeshImporterFromFbx

Source code excerpt:


	FindOrImportMaterialsFromNode(Node, Materials, UVSets, bForSkeletalMesh);
	if (!ImportOptions->bImportMaterials && ImportOptions->bImportTextures)
	{
		//If we are not importing any new material, we might still want to import new textures.
		ImportTexturesFromNode(Node);
	}

	// Maps local mesh material index to global material index

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxStaticMeshImport.cpp:421

Scope (from outer to inner):

file
function     bool UnFbx::FFbxImporter::BuildStaticMeshFromGeometry

Source code excerpt:

		
		FindOrImportMaterialsFromNode(Node, FbxMeshMaterials, FBXUVs.UVSets, bForSkeletalMesh);
		if (!ImportOptions->bImportMaterials && ImportOptions->bImportTextures)
		{
			//If we are not importing any new material, we might still want to import new textures.
			ImportTexturesFromNode(Node);
		}

		MaterialCount = Node->GetMaterialCount();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxStaticMeshImport.cpp:1528

Scope (from outer to inner):

file
function     UStaticMesh* UnFbx::FFbxImporter::ReimportStaticMesh

Source code excerpt:

	
	ImportOptions->bImportMaterials = false;
	ImportOptions->bImportTextures = false;

	// Before calling SaveExistingStaticMeshData() we must remove the existing fbx metadata as we don't want to restore those.
	RemoveFBXMetaData(Mesh);
	TSharedPtr<FExistingStaticMeshData> ExistMeshDataPtr = StaticMeshImportUtils::SaveExistingStaticMeshData(Mesh, ImportOptions, INDEX_NONE);

	TArray<int32> ReimportLodList;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/ReimportFbxSceneFactory.cpp:234

Scope (from outer to inner):

file
function     bool GetFbxSceneReImportOptions

Source code excerpt:

	GlobalImportSettings->bUsedAsFullName = true;
	//Make sure we import the textures
	GlobalImportSettings->bImportTextures = true;
	//Make sure Material get imported
	GlobalImportSettings->bImportMaterials = true;
	//TODO support T0AsRefPose
	GlobalImportSettings->bUseT0AsRefPose = false;
	//Make sure skeletal mesh sections with the same material are combined (and not kept separate)
	GlobalImportSettings->bKeepSectionsSeparate = false;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/FbxMeshUtils.cpp:88

Scope (from outer to inner):

file
namespace    FbxMeshUtils
namespace    Private
function     void SetupFbxImportOptions

Source code excerpt:

			ImportOptions->bIsImportCancelable = false;
			ImportOptions->bImportMaterials = false;
			ImportOptions->bImportTextures = false;

			ImportOptions->bAutoComputeLodDistances = true; //Setting auto compute distance to true will avoid changing the staticmesh flag
		}

		bool CopyHighResMeshDescription(UStaticMesh* SrcStaticMesh, UStaticMesh* BaseStaticMesh)
		{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/FbxMeshUtils.cpp:613

Scope (from outer to inner):

file
namespace    FbxMeshUtils
function     bool ImportSkeletalMeshLOD

Source code excerpt:

			}
			ImportOptions->bImportMaterials = false;
			ImportOptions->bImportTextures = false;
		}
		ImportOptions->bImportAnimations = false;
		//Adjust the option in case we import only the skinning or the geometry
		if (ImportOptions->bImportAsSkeletalSkinning)
		{
			ImportOptions->bImportMaterials = false;
			ImportOptions->bImportTextures = false;
			ImportOptions->bImportLOD = false;
			ImportOptions->bImportSkeletalMeshLODs = false;
			ImportOptions->bImportAnimations = false;
			ImportOptions->bImportMorph = false;
		}
		else if (ImportOptions->bImportAsSkeletalGeometry)

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SkinWeightsUtilities.cpp:178

Scope (from outer to inner):

file
function     bool FSkinWeightsUtilities::ImportAlternateSkinWeight

Source code excerpt:

		FbxFactory->ImportUI->bCreatePhysicsAsset = false;
		FbxFactory->ImportUI->bImportMaterials = false;
		FbxFactory->ImportUI->bImportTextures = false;
		FbxFactory->ImportUI->bImportMesh = true;
		FbxFactory->ImportUI->bImportRigidMesh = false;
		FbxFactory->ImportUI->bIsObjImport = false;
		FbxFactory->ImportUI->bOverrideFullName = true;
		FbxFactory->ImportUI->Skeleton = nullptr;

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

Scope (from outer to inner):

file
namespace    UnFbx

Source code excerpt:

	bool bImportMaterials;
	bool bInvertNormalMap;
	bool bImportTextures;
	bool bImportLOD;
	bool bUsedAsFullName;
	bool bConvertScene;
	bool bForceFrontXAxis;
	bool bConvertSceneUnit;
	bool bRemoveNameSpace;