Files
ryan schmidt f9810df402 GeometryProcessing: Added FMeshAttributeTransfer class, currently supports transferring triangle material IDs from one mesh to another, via nearest-point queries
GeometryFlow: Added FCompactMeshNode, FComputeMeshPerVertexOverlayNormalsNode (convenient), and FTransferMeshMaterialIDsNode that applies FMeshAttributeTransfer based on two input meshes. Graph InferConnection() now is more clever and can infer connections in cases where a potentially-ambiguous connection is resolved based on what is already connected (ie if two mesh inputs, and one is assigned, infer that second one is intended)

LODToolset: LODGraph now transfers materials and computes per-vertex normals before Simplify node, and Compacts afterwards (required for other downstream processes).
LODProcess now handles multiple materials, and can re-use input materials if they do not require a baked texture or normal map. In repeat applications, previously-auto-generated StaticMesh Materials are detected and removed from the material set. Normals and Tangents are explicitly computed for stored HiRes source and LOD0, and build settings updated appropriately.

#rb none
#rnx
#jira none
[FYI] tyson.brochu

#ROBOMERGE-SOURCE: CL 15470041 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15470044 by ryan schmidt in ue5-main branch]
2021-02-19 01:48:21 -04:00

48 lines
898 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MeshProcessingNodes/MeshProcessingBaseNodes.h"
#include "MeshProcessingNodes/MeshProcessingDataTypes.h"
namespace UE
{
namespace GeometryFlow
{
/**
* FCompactMeshNode compacts the input mesh, to remove gaps in the vertex/triangle indexing. This node can be applied in-place.
*/
class FCompactMeshNode : public FProcessMeshBaseNode
{
public:
FCompactMeshNode()
{
// we can mutate input mesh
ConfigureInputFlags(InParamMesh(), FNodeInputFlags::Transformable());
}
virtual void ProcessMesh(
const FNamedDataMap& DatasIn,
const FDynamicMesh3& MeshIn,
FDynamicMesh3& MeshOut) override
{
MeshOut.CompactCopy(MeshIn);
}
virtual void ProcessMeshInPlace(
const FNamedDataMap& DatasIn,
FDynamicMesh3& MeshInOut) override
{
MeshInOut.CompactInPlace();
}
};
} // end namespace GeometryFlow
} //