ImportGeometryType

ImportGeometryType

#Overview

name: ImportGeometryType

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

#Summary

#Usage in the C++ source code

The purpose of ImportGeometryType is to determine the type of geometry to import for a SpeedTree asset in Unreal Engine 5. It is used to control whether the imported SpeedTree asset should be a 3D model, a billboard, or both.

This setting variable is primarily used in the SpeedTreeImporter plugin, which is responsible for importing SpeedTree assets into Unreal Engine. The main subsystems that rely on this variable are the asset import system and the static mesh creation system.

The value of this variable is set in the USpeedTreeImportData class, which is part of the SpeedTree import configuration. It is initialized in the constructor of USpeedTreeImportData with a default value of IGT_3D.

ImportGeometryType interacts with other variables in the SpeedTree import process, such as LODType and TreeScale. It also influences the creation of materials and the handling of different LOD levels during the import process.

Developers must be aware that:

  1. The choice of ImportGeometryType affects the performance and visual quality of the imported SpeedTree asset.
  2. It determines which parts of the SpeedTree geometry are imported and how they are processed.
  3. The variable’s value can impact the creation of LODs and materials for the imported asset.

Best practices when using this variable include:

  1. Choose the appropriate ImportGeometryType based on the intended use of the SpeedTree asset in the game or project.
  2. Consider performance implications when selecting between 3D geometry and billboards.
  3. Ensure that the chosen ImportGeometryType is compatible with the source SpeedTree file’s content.
  4. Review and adjust other related import settings (like LODType) to ensure they complement the chosen ImportGeometryType.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:941, section: [/Script/SpeedTreeImporter.SpeedTreeImportData]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Classes/SpeedTreeImportData.h:53

Scope (from outer to inner):

file
class        class USpeedTreeImportData : public UAssetImportData

Source code excerpt:

	/** Choose whether to import as a 3D asset, billboard or both */
	UPROPERTY(EditAnywhere, config, Category=Mesh, meta = (DisplayName = "Geometry"))
	TEnumAsByte<enum EImportGeometryType> ImportGeometryType;

	/** Choose whether painted foliage or individual actor */
	UPROPERTY(EditAnywhere, config, Category=Mesh, meta = (DisplayName = "LOD Setup", SpeedTreeVersion = "8"))
	TEnumAsByte<enum EImportLODType> LODType;

	/**  */

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportData.cpp:29

Scope (from outer to inner):

file
function     USpeedTreeImportData::USpeedTreeImportData

Source code excerpt:

	: Super(ObjectInitializer)
{
	ImportGeometryType = IGT_3D;
	TreeScale = 30.48f;
	LODType = ILT_PaintedFoliage;
}

void USpeedTreeImportData::CopyFrom(USpeedTreeImportData* Other)
{
	TreeScale = Other->TreeScale;
	ImportGeometryType = Other->ImportGeometryType;
	LODType = Other->LODType;
	IncludeCollision = Other->IncludeCollision;
	MakeMaterialsCheck = Other->MakeMaterialsCheck;
	IncludeNormalMapCheck = Other->IncludeNormalMapCheck;
	IncludeDetailMapCheck = Other->IncludeDetailMapCheck;
	IncludeSpecularMapCheck = Other->IncludeSpecularMapCheck;

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportData.cpp:90

Scope (from outer to inner):

file
function     void FSpeedTreeImportDataDetails::CustomizeDetails

Source code excerpt:

	{
		DetailLayout.HideProperty(FName(TEXT("TreeScale")));
		DetailLayout.HideProperty(FName(TEXT("ImportGeometryType")));
	}

	//Get the Materials category
	IDetailCategoryBuilder& MaterialsCategoryBuilder = DetailLayout.EditCategory(FName(TEXT("Materials")));
	TArray<TSharedRef<IPropertyHandle>> MaterialCategoryDefaultProperties;
	MaterialsCategoryBuilder.GetDefaultProperties(MaterialCategoryDefaultProperties);

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportFactory.cpp:2012

Scope (from outer to inner):

file
function     UObject* USpeedTreeImportFactory::FactoryCreateBinary7

Source code excerpt:


			const SpeedTree::SGeometry* SpeedTreeGeometry = SpeedTree.GetGeometry();
			if ((SpeedTreeImportData->ImportGeometryType == EImportGeometryType::IGT_Billboards && SpeedTreeGeometry->m_sVertBBs.m_nNumBillboards == 0) ||
				(SpeedTreeImportData->ImportGeometryType == EImportGeometryType::IGT_3D && SpeedTreeGeometry->m_nNumLods == 0))
			{
				UE_LOG(LogSpeedTreeImport, Error, TEXT("Tree contains no useable geometry"));
			}
			else
			{
				LoadedPackages.Empty( );

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportFactory.cpp:2086

Scope (from outer to inner):

file
function     UObject* USpeedTreeImportFactory::FactoryCreateBinary7

Source code excerpt:

				{
					int32 TotalLODs = 0;
					if (SpeedTreeImportData->ImportGeometryType != EImportGeometryType::IGT_Billboards)
					{
						TotalLODs += SpeedTreeGeometry->m_nNumLods;
					}
					if (SpeedTreeImportData->ImportGeometryType != EImportGeometryType::IGT_3D && SpeedTreeGeometry->m_sVertBBs.m_nNumBillboards > 0)
					{
						++TotalLODs;
					}
					if (TotalLODs < 2)
					{
						SpeedTreeImportData->IncludeSmoothLODCheck = !SpeedTreeImportData->IncludeSmoothLODCheck;

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportFactory.cpp:2101

Scope (from outer to inner):

file
function     UObject* USpeedTreeImportFactory::FactoryCreateBinary7

Source code excerpt:


				// make geometry LODs
				if (SpeedTreeImportData->ImportGeometryType != EImportGeometryType::IGT_Billboards)
				{
					int32 BranchMaterialsMade = 0;
					int32 FrondMaterialsMade = 0;
					int32 LeafMaterialsMade = 0;
					int32 FacingLeafMaterialsMade = 0;
					int32 MeshMaterialsMade = 0;

#Loc: <Workspace>/Engine/Plugins/Editor/SpeedTreeImporter/Source/SpeedTreeImporter/Private/SpeedTreeImportFactory.cpp:2283

Scope (from outer to inner):

file
function     UObject* USpeedTreeImportFactory::FactoryCreateBinary7

Source code excerpt:


				// make billboard LOD
				if (SpeedTreeImportData->ImportGeometryType != EImportGeometryType::IGT_3D && SpeedTreeGeometry->m_sVertBBs.m_nNumBillboards > 0)
				{
					FStaticMeshSourceModel& LODModel = StaticMesh->AddSourceModel();
					const int32 LODIndex = StaticMesh->GetNumSourceModels() - 1;
					FMeshDescription* MeshDescription = StaticMesh->CreateMeshDescription(LODIndex);
					FStaticMeshAttributes Attributes(*MeshDescription);