Files
UnrealEngineUWP/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Public/AssetUtils/MeshDescriptionUtil.h
ryan schmidt 250bc3a820 Re-add a few symbol exports that were lost in UE5 branching.
#rb tyson.brochu
#preflight 62211dad4e07145cce561fd4
#jira none
#rnx

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19252433 in //UE5/Release-5.0/... via CL 19252680
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v924-19243027)

[CL 19263458 by ryan schmidt in ue5-main branch]
2022-03-04 03:42:23 -05:00

68 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
// predeclare engine types
class UStaticMesh;
class UActorComponent;
struct FMeshBuildSettings;
struct FMeshDescription;
namespace UE
{
namespace MeshDescription
{
//
// Utility functions to preprocess a MeshDescription so that it is suitable for use in Modeling Tools, ie with fully-populated
// autogen normals/tangents/etc.
//
/**
* Populate any auto-generated attributes of a FMeshDescription that are currently invalid (eg Normals/Tangents, which may be zero until calculated)
*/
MODELINGCOMPONENTS_API void InitializeAutoGeneratedAttributes(FMeshDescription& Mesh, const FMeshBuildSettings* BuildSettings);
/**
* Populate any auto-generated attributes of a FMeshDescription that are currently invalid (eg Normals/Tangents, which may be zero until calculated)
* @param StaticMesh BuildSettings for the Mesh are fetched from this UStaticMesh
* @param SourceLOD BuildSettings from this LOD Index are used
*/
MODELINGCOMPONENTS_API void InitializeAutoGeneratedAttributes(FMeshDescription& Mesh, UStaticMesh* StaticMesh, int32 SourceLOD);
/**
* Populate any auto-generated attributes of a FMeshDescription that are currently invalid (eg Normals/Tangents, which may be zero until calculated)
* @param StaticMeshComponent BuildSettings for the Mesh are fetched from this Component's UStaticMesh
* @param SourceLOD BuildSettings from this LOD Index are used
*/
MODELINGCOMPONENTS_API void InitializeAutoGeneratedAttributes(FMeshDescription& Mesh, UActorComponent* StaticMeshComponent, int32 SourceLOD);
//
// Utility functions to update UStaticMesh build settings
//
/** How to update a boolean build setting */
enum class MODELINGCOMPONENTS_API EBuildSettingBoolChange
{
Disable,
Enable,
NoChange
};
/** Set of changes to apply to StaticMesh Build Settings */
struct MODELINGCOMPONENTS_API FStaticMeshBuildSettingChange
{
EBuildSettingBoolChange AutoGeneratedNormals = EBuildSettingBoolChange::NoChange;
EBuildSettingBoolChange AutoGeneratedTangents = EBuildSettingBoolChange::NoChange;
EBuildSettingBoolChange UseMikkTSpaceTangents = EBuildSettingBoolChange::NoChange;
};
/** Utility function to apply build settings changes to a UStaticMesh */
MODELINGCOMPONENTS_API void ConfigureBuildSettings(UStaticMesh* StaticMesh, int32 SourceLOD,
FStaticMeshBuildSettingChange NewSettings);
}
}