bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing

bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing

#Overview

name: bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing

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

#Summary

#Usage in the C++ source code

The purpose of bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing is to determine how edge smoothing should be handled when importing static meshes that lack explicit smoothing information. This setting is primarily used in the mesh import process, specifically for static meshes.

This setting variable is relied upon by the Unreal Engine’s Interchange system, which is responsible for importing and processing various asset types, including static meshes. It’s used in both the Interchange Runtime plugin and the UnrealEd module.

The value of this variable is set in the Interchange Project Settings. It’s a boolean property that can be configured in the project settings UI or directly in the config files.

This variable interacts with the edge hardness calculation during mesh import. When set to true, it causes the importer to use smooth edges for static meshes if smoothing information is missing. When false, it defaults to hard edges in such cases.

Developers must be aware that this setting can significantly affect the appearance of imported static meshes, especially those without explicit smoothing information. It can impact the visual quality and performance of rendered meshes.

Best practices when using this variable include:

  1. Ensuring that source assets have proper smoothing information whenever possible to reduce reliance on this fallback behavior.
  2. Considering the visual requirements of the project when setting this value.
  3. Testing the import results with both true and false settings to determine which provides better results for the specific assets being used.
  4. Documenting the chosen setting and its rationale for the development team to ensure consistent asset importing across the project.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3502, section: [/Script/InterchangeEngine.InterchangeProjectSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Parsers/Fbx/Private/FbxMesh.cpp:585

Scope (from outer to inner):

file
namespace    UE::Interchange::Private
function     bool FMeshDescriptionImporter::FillMeshDescriptionFromFbxMesh

Source code excerpt:

	Attributes.Register(bKeepExistingAttribute);

	bool bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing = true;

#if WITH_ENGINE
	//Get the default hard/smooth edges from the project settings
	const UInterchangeProjectSettings* InterchangeProjectSettings = GetDefault<UInterchangeProjectSettings>();
	bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing = InterchangeProjectSettings->bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing;
#endif

	//Get the base layer of the mesh
	FbxLayer* BaseLayer = Mesh->GetLayer(0);
	if (BaseLayer == NULL)
	{

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Parsers/Fbx/Private/FbxMesh.cpp:1283

Scope (from outer to inner):

file
namespace    UE::Interchange::Private
function     bool FMeshDescriptionImporter::FillMeshDescriptionFromFbxMesh

Source code excerpt:

							{
								//When there is no smoothing group we set all edge to: hard (faceted mesh) for static mesh and smooth for skinned and rigid
								EdgeHardnesses[MatchEdgeId] = MeshType == EMeshType::Static ? !bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing : false;
							}
						}
					}
				}

				FPolygonGroupID PolygonGroupID = PolygonGroupMapping[MaterialIndex];

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

Scope (from outer to inner):

file
function     bool UnFbx::FFbxImporter::BuildStaticMeshFromGeometry

Source code excerpt:

	//Get the default hard/smooth edges from the project settings
	const UInterchangeProjectSettings* InterchangeProjectSettings = GetDefault<UInterchangeProjectSettings>();
	const bool bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing = InterchangeProjectSettings->bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing;

	//
	// create materials
	//
	int32 MaterialCount = 0;
	int32 MaterialIndexOffset = 0;

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

Scope (from outer to inner):

file
function     bool UnFbx::FFbxImporter::BuildStaticMeshFromGeometry

Source code excerpt:

							{
								//When there is no smoothing group we set all edge to hard (faceted mesh) or false depending on the project settings
								EdgeHardnesses[MatchEdgeId] = !bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing;
							}
						}
					}
				}

				FPolygonGroupID PolygonGroupID = PolygonGroupMapping[RealMaterialIndex];

#Loc: <Workspace>/Engine/Source/Runtime/Interchange/Engine/Public/InterchangeProjectSettings.h:126

Scope (from outer to inner):

file
class        class UInterchangeProjectSettings : public UDeveloperSettings

Source code excerpt:

	 */
	UPROPERTY(EditAnywhere, config, Category = "Generic|ImportSettings")
	bool bStaticMeshUseSmoothEdgesIfSmoothingInformationIsMissing = true;

	/**
	 * Specifies which pipeline class Interchange should use when editor tools import or reimport an asset with base settings.
	 * Unreal Editor depends on this class to be set. You can only edit this property in the .ini file.
	 */
	UPROPERTY(EditAnywhere, config, Category = "Editor Generic Pipeline Class")