bImportMeshLODs
bImportMeshLODs
#Overview
name: bImportMeshLODs
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 18
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bImportMeshLODs is to control whether Levels of Detail (LODs) for meshes should be imported from FBX files. This setting is primarily used in the mesh import process for both static and skeletal meshes in Unreal Engine.
Key points about bImportMeshLODs:
-
Subsystems: This variable is used in the FBX import system, which is part of the Unreal Editor’s asset import pipeline. It’s specifically used in the static mesh and skeletal mesh import processes.
-
Modules: It’s primarily used in the UnrealEd module and the InterchangeEditor plugin.
-
Value setting: The value is typically set in the import UI (UFbxImportUI) and then passed to the actual import options (FBXImportOptions).
-
Interactions: It interacts with other import settings like bCombineMeshes and affects how LODs are processed during import.
-
Usage considerations:
- When set to true, it allows importing multiple LOD levels from the FBX file.
- When false, only the base mesh (LOD0) is imported.
- It’s used for both static and skeletal meshes, with separate variables for each (bImportStaticMeshLODs and bImportSkeletalMeshLODs).
-
Best practices:
- Enable this option when your FBX file contains multiple LOD levels that you want to use in Unreal Engine.
- Disable it if you only want to import the base mesh and handle LODs manually within the engine.
- Consider your project’s performance requirements and asset pipeline when deciding whether to import LODs or create them within Unreal Engine.
Developers should be aware that this setting can significantly affect the imported mesh structure and subsequent LOD setup in the engine. It’s important to ensure that the FBX file is properly set up with LOD groups if this option is enabled.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:649, section: [/Script/UnrealEd.FbxMeshImportData]
- INI Section:
/Script/UnrealEd.FbxMeshImportData
- Raw value:
False
- Is Array:
False
#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:67
Scope (from outer to inner):
file
namespace UE::Interchange::Private
function void FillFbxMeshImportData
Source code excerpt:
MeshImportData->bBakePivotInVertex = false;
MeshImportData->bComputeWeightedNormals = GenericAssetPipeline->CommonMeshesProperties->bComputeWeightedNormals;
MeshImportData->bImportMeshLODs = GenericAssetPipeline->CommonMeshesProperties->bImportLods;
MeshImportData->bReorderMaterialToFbxOrder = true;
MeshImportData->bTransformVertexToAbsolute = GenericAssetPipeline->CommonMeshesProperties->bBakeMeshes;
if (GenericAssetPipeline->CommonMeshesProperties->bUseMikkTSpace)
{
MeshImportData->NormalGenerationMethod = EFBXNormalGenerationMethod::MikkTSpace;
#Loc: <Workspace>/Engine/Plugins/Interchange/Editor/Source/InterchangeEditor/Private/InterchangeFbxAssetImportDataConverter.cpp:105
Scope (from outer to inner):
file
namespace UE::Interchange::Private
function void FillInterchangeGenericAssetsPipelineFromFbxMeshImportData
Source code excerpt:
GenericAssetPipeline->CommonMeshesProperties->bComputeWeightedNormals = LegacyMeshImportData->bComputeWeightedNormals;
GenericAssetPipeline->CommonMeshesProperties->bImportLods = LegacyMeshImportData->bImportMeshLODs;
GenericAssetPipeline->CommonMeshesProperties->bBakeMeshes = LegacyMeshImportData->bTransformVertexToAbsolute;
if (LegacyMeshImportData->NormalGenerationMethod == EFBXNormalGenerationMethod::MikkTSpace)
{
GenericAssetPipeline->CommonMeshesProperties->bUseMikkTSpace = true;
}
#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/FbxAutomationTests.cpp:390
Scope (from outer to inner):
file
function BEGIN_FUNCTION_BUILD_OPTIMIZATION bool F
Source code excerpt:
ImportData->bTransformVertexToAbsolute = TestPlan->ImportUI->StaticMeshImportData->bTransformVertexToAbsolute;
ImportData->bBakePivotInVertex = TestPlan->ImportUI->StaticMeshImportData->bBakePivotInVertex;
ImportData->bImportMeshLODs = TestPlan->ImportUI->StaticMeshImportData->bImportMeshLODs;
ImportData->NormalImportMethod = TestPlan->ImportUI->StaticMeshImportData->NormalImportMethod;
ImportData->NormalGenerationMethod = TestPlan->ImportUI->StaticMeshImportData->NormalGenerationMethod;
ImportData->bComputeWeightedNormals = TestPlan->ImportUI->StaticMeshImportData->bComputeWeightedNormals;
//Copy UFbxAssetImportData
ImportData->ImportTranslation = TestPlan->ImportUI->StaticMeshImportData->ImportTranslation;
ImportData->ImportRotation = TestPlan->ImportUI->StaticMeshImportData->ImportRotation;
#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/FbxAutomationTests.cpp:433
Scope (from outer to inner):
file
function BEGIN_FUNCTION_BUILD_OPTIMIZATION bool F
Source code excerpt:
ImportData->bTransformVertexToAbsolute = TestPlan->ImportUI->SkeletalMeshImportData->bTransformVertexToAbsolute;
ImportData->bBakePivotInVertex = TestPlan->ImportUI->SkeletalMeshImportData->bBakePivotInVertex;
ImportData->bImportMeshLODs = TestPlan->ImportUI->SkeletalMeshImportData->bImportMeshLODs;
ImportData->NormalImportMethod = TestPlan->ImportUI->SkeletalMeshImportData->NormalImportMethod;
ImportData->NormalGenerationMethod = TestPlan->ImportUI->SkeletalMeshImportData->NormalGenerationMethod;
//Copy UFbxAssetImportData
ImportData->ImportTranslation = TestPlan->ImportUI->SkeletalMeshImportData->ImportTranslation;
ImportData->ImportRotation = TestPlan->ImportUI->SkeletalMeshImportData->ImportRotation;
ImportData->ImportUniformScale = TestPlan->ImportUI->SkeletalMeshImportData->ImportUniformScale;
#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/FbxAutomationTests.cpp:498
Scope (from outer to inner):
file
function BEGIN_FUNCTION_BUILD_OPTIMIZATION bool F
Source code excerpt:
ImportData->bTransformVertexToAbsolute = TestPlan->ImportUI->StaticMeshImportData->bTransformVertexToAbsolute;
ImportData->bBakePivotInVertex = TestPlan->ImportUI->StaticMeshImportData->bBakePivotInVertex;
ImportData->bImportMeshLODs = TestPlan->ImportUI->StaticMeshImportData->bImportMeshLODs;
ImportData->NormalImportMethod = TestPlan->ImportUI->StaticMeshImportData->NormalImportMethod;
ImportData->NormalGenerationMethod = TestPlan->ImportUI->StaticMeshImportData->NormalGenerationMethod;
ImportData->bComputeWeightedNormals = TestPlan->ImportUI->StaticMeshImportData->bComputeWeightedNormals;
//Copy UFbxAssetImportData
ImportData->ImportTranslation = TestPlan->ImportUI->StaticMeshImportData->ImportTranslation;
ImportData->ImportRotation = TestPlan->ImportUI->StaticMeshImportData->ImportRotation;
#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/FbxAutomationTests.cpp:531
Scope (from outer to inner):
file
function BEGIN_FUNCTION_BUILD_OPTIMIZATION bool F
Source code excerpt:
ImportData->bTransformVertexToAbsolute = TestPlan->ImportUI->SkeletalMeshImportData->bTransformVertexToAbsolute;
ImportData->bBakePivotInVertex = TestPlan->ImportUI->SkeletalMeshImportData->bBakePivotInVertex;
ImportData->bImportMeshLODs = TestPlan->ImportUI->SkeletalMeshImportData->bImportMeshLODs;
ImportData->NormalImportMethod = TestPlan->ImportUI->SkeletalMeshImportData->NormalImportMethod;
ImportData->NormalGenerationMethod = TestPlan->ImportUI->SkeletalMeshImportData->NormalGenerationMethod;
//Copy UFbxAssetImportData
ImportData->ImportTranslation = TestPlan->ImportUI->SkeletalMeshImportData->ImportTranslation;
ImportData->ImportRotation = TestPlan->ImportUI->SkeletalMeshImportData->ImportRotation;
ImportData->ImportUniformScale = TestPlan->ImportUI->SkeletalMeshImportData->ImportUniformScale;
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:325
Scope (from outer to inner):
file
function void FFbxImportUIDetails::CustomizeDetails
Source code excerpt:
ImportAutoComputeLodDistancesProp->SetOnPropertyValueChanged(FSimpleDelegate::CreateSP(this, &FFbxImportUIDetails::ImportAutoComputeLodDistancesChanged));
TSharedPtr<IPropertyHandle> ImportMeshLODsProp = StaticMeshDataProp->GetChildHandle(GET_MEMBER_NAME_CHECKED(UFbxStaticMeshImportData, bImportMeshLODs));
ImportMeshLODsProp->SetOnPropertyValueChanged(FSimpleDelegate::CreateSP(this, &FFbxImportUIDetails::RefreshCustomDetail));
MeshCategory.GetDefaultProperties(CategoryDefaultProperties);
switch(ImportUI->MeshTypeToImport)
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/FbxImportUIDetails.cpp:365
Scope (from outer to inner):
file
function void FFbxImportUIDetails::CustomizeDetails
Source code excerpt:
//Hide LodDistance property if we do not need them
if (ImportUI->bIsReimport || ImportType != FBXIT_StaticMesh || !ImportUI->StaticMeshImportData->bImportMeshLODs)
{
DetailBuilder.HideCategory(FName(TEXT("LodSettings")));
}
else
{
int32 ShowMaxLodIndex = (ImportUI->bAutoComputeLodDistances ? 0 : ImportUI->LodNumber > 0 ? ImportUI->LodNumber : MAX_STATIC_MESH_LODS) - 1;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Factories/FbxMeshImportData.h:72
Scope (from outer to inner):
file
class class UFbxMeshImportData : public UFbxAssetImportData
Source code excerpt:
/** Enables importing of mesh LODs from FBX LOD groups, if present in the FBX file */
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, config, Category= Mesh, meta=(OBJRestrict="true", ImportType="Mesh|GeoOnly", ToolTip="If enabled, creates LOD models for Unreal meshes from LODs in the import file; If not enabled, only the base mesh from the LOD group is imported"))
uint32 bImportMeshLODs:1;
/** Enabling this option will read the tangents(tangent,binormal,normal) from FBX file instead of generating them automatically. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, config, Category= Mesh, meta=(ImportType="Mesh|GeoOnly"))
TEnumAsByte<enum EFBXNormalImportMethod> NormalImportMethod;
/** Use the MikkTSpace tangent space generator for generating normals and tangents on the mesh */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxFactory.cpp:431
Scope (from outer to inner):
file
function UObject* UFbxFactory::FactoryCreateFile
Source code excerpt:
TArray< TArray<FbxNode*>* > SkelMeshArray;
bool bImportStaticMeshLODs = ImportUI->StaticMeshImportData->bImportMeshLODs;
bool bCombineMeshes = ImportUI->StaticMeshImportData->bCombineMeshes;
bool bCombineMeshesLOD = false;
const bool bCanImportStaticMesh = FbxImporter->CanImportClass(UStaticMesh::StaticClass());
//We can import skeletal mesh only if we can import skeleton or a skeleton was specified in the import options
const bool bCanImportSkeletalMesh = FbxImporter->CanImportClass(USkeletalMesh::StaticClass()) && (ImportOptions->SkeletonForAnimation || FbxImporter->CanImportClass(USkeleton::StaticClass()));
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxFactory.cpp:665
Scope (from outer to inner):
file
function UObject* UFbxFactory::FactoryCreateFile
Source code excerpt:
int32 SuccessfulLodIndex = 0;
bool bImportSkeletalMeshLODs = ImportUI->SkeletalMeshImportData->bImportMeshLODs;
//The skeletalmesh will be set after we import the LOD 0 since it is not created yet.
FScopedSkeletalMeshPostEditChange ScopedPostEditChange(nullptr);
for (int32 LODIndex = 0; LODIndex < MaxNumberOfLOD && !bOperationCanceled; LODIndex++)
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxFactory.cpp:1004
Scope (from outer to inner):
file
function UObject* UFbxFactory::RecursiveImportNode
Source code excerpt:
}
bool bImportMeshLODs = ImportUI->StaticMeshImportData->bImportMeshLODs;
if (CreatedObject && bImportMeshLODs)
{
// import LOD meshes
SlowTask.TotalAmountOfWork += Node->GetChildCount();
for (int32 LODIndex = 1; LODIndex < Node->GetChildCount(); LODIndex++)
{
if (LODIndex >= MAX_STATIC_MESH_LODS)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxFactory.cpp:1596
Scope (from outer to inner):
file
namespace ImportCompareHelper
function void FillStaticMeshCompareData
Source code excerpt:
//Find the array of nodes to re-import
TArray<FbxNode*> FbxMeshArray;
bool bImportStaticMeshLODs = ImportUI->StaticMeshImportData->bImportMeshLODs;
bool bCombineMeshes = ImportUI->StaticMeshImportData->bCombineMeshes;
bool bCombineMeshesLOD = false;
TArray<TArray<FbxNode*>> FbxMeshesLod;
FbxNode* Node = nullptr;
if (bCombineMeshes && !bImportStaticMeshLODs)
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMainImport.cpp:414
Scope (from outer to inner):
file
namespace UnFbx
function void ApplyImportUIToImportOptions
Source code excerpt:
InOutImportOptions.bTransformVertexToAbsolute = StaticMeshData->bTransformVertexToAbsolute;
InOutImportOptions.bBakePivotInVertex = StaticMeshData->bBakePivotInVertex;
InOutImportOptions.bImportStaticMeshLODs = StaticMeshData->bImportMeshLODs;
InOutImportOptions.bConvertScene = StaticMeshData->bConvertScene;
InOutImportOptions.bForceFrontXAxis = StaticMeshData->bForceFrontXAxis;
InOutImportOptions.bConvertSceneUnit = StaticMeshData->bConvertSceneUnit;
InOutImportOptions.VertexColorImportOption = StaticMeshData->VertexColorImportOption;
InOutImportOptions.VertexOverrideColor = StaticMeshData->VertexOverrideColor;
InOutImportOptions.bReorderMaterialToFbxOrder = StaticMeshData->bReorderMaterialToFbxOrder;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxMainImport.cpp:434
Scope (from outer to inner):
file
namespace UnFbx
function void ApplyImportUIToImportOptions
Source code excerpt:
InOutImportOptions.bTransformVertexToAbsolute = SkeletalMeshData->bTransformVertexToAbsolute;
InOutImportOptions.bBakePivotInVertex = SkeletalMeshData->bBakePivotInVertex;
InOutImportOptions.bImportSkeletalMeshLODs = SkeletalMeshData->bImportMeshLODs;
InOutImportOptions.bConvertScene = SkeletalMeshData->bConvertScene;
InOutImportOptions.bForceFrontXAxis = SkeletalMeshData->bForceFrontXAxis;
InOutImportOptions.bConvertSceneUnit = SkeletalMeshData->bConvertSceneUnit;
InOutImportOptions.VertexColorImportOption = SkeletalMeshData->VertexColorImportOption;
InOutImportOptions.VertexOverrideColor = SkeletalMeshData->VertexOverrideColor;
InOutImportOptions.bReorderMaterialToFbxOrder = SkeletalMeshData->bReorderMaterialToFbxOrder;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSceneImportOptionsSkeletalMesh.cpp:53
Scope (from outer to inner):
file
function void UFbxSceneImportOptionsSkeletalMesh::FillSkeletalMeshInmportData
Source code excerpt:
SkeletalMeshImportData->bUseT0AsRefPose = bUseT0AsRefPose;
SkeletalMeshImportData->bImportMeshLODs = SceneImportOptions->bImportSkeletalMeshLODs;
SkeletalMeshImportData->ImportTranslation = SceneImportOptions->ImportTranslation;
SkeletalMeshImportData->ImportRotation = SceneImportOptions->ImportRotation;
SkeletalMeshImportData->ImportUniformScale = SceneImportOptions->ImportUniformScale;
SkeletalMeshImportData->bTransformVertexToAbsolute = SceneImportOptions->bTransformVertexToAbsolute;
SkeletalMeshImportData->bBakePivotInVertex = SceneImportOptions->bBakePivotInVertex;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxSceneImportOptionsStaticMesh.cpp:52
Scope (from outer to inner):
file
function void UFbxSceneImportOptionsStaticMesh::FillStaticMeshInmportData
Source code excerpt:
//Scene general options
StaticMeshImportData->bImportMeshLODs = SceneImportOptions->bImportStaticMeshLODs;
StaticMeshImportData->ImportTranslation = SceneImportOptions->ImportTranslation;
StaticMeshImportData->ImportRotation = SceneImportOptions->ImportRotation;
StaticMeshImportData->ImportUniformScale = SceneImportOptions->ImportUniformScale;
StaticMeshImportData->bTransformVertexToAbsolute = SceneImportOptions->bTransformVertexToAbsolute;
StaticMeshImportData->bBakePivotInVertex = SceneImportOptions->bBakePivotInVertex;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SkinWeightsUtilities.cpp:188
Scope (from outer to inner):
file
function bool FSkinWeightsUtilities::ImportAlternateSkinWeight
Source code excerpt:
if (FbxFactory->ImportUI->SkeletalMeshImportData)
{
FbxFactory->ImportUI->SkeletalMeshImportData->bImportMeshLODs = false;
FbxFactory->ImportUI->SkeletalMeshImportData->bImportMorphTargets = false;
FbxFactory->ImportUI->SkeletalMeshImportData->bUpdateSkeletonReferencePose = false;
FbxFactory->ImportUI->SkeletalMeshImportData->ImportContentType = EFBXImportContentType::FBXICT_All; //We need geo and skinning, so we can match the weights
}
//Force some material options
if (FbxFactory->ImportUI->TextureImportData)