Files
Ryan Schmidt ce7fda8364 DynamicMesh: add function MakeUniqueGroupLayerName that will make a unique group name given a base name
ModelingTools: add support for writing to selected group layer, as well as new group layer, in ConvertToPolygonsTool (GrpGen in UI). Also add support for setting groups from existing layer, which (combined) allows copying groups between layers, duplicating existing layer, and so on.
#rb none
#preflight 630e3856e11248377555f234

[CL 21704364 by Ryan Schmidt in ue5-main branch]
2022-08-30 13:00:48 -04:00

47 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "DynamicMesh/DynamicMesh3.h"
#include "DynamicMesh/DynamicMeshAttributeSet.h"
namespace UE
{
namespace Geometry
{
/**
* Find the first FDynamicMeshPolygroupAttribute with the given FName in a the AttributeSet of a Mesh.
* @return nullptr if no Polygroup layer is found
*/
DYNAMICMESH_API FDynamicMeshPolygroupAttribute* FindPolygroupLayerByName(FDynamicMesh3& Mesh, FName Name);
/**
* Find the first FDynamicMeshPolygroupAttribute with the given FName in a the AttributeSet of a Mesh.
* @return nullptr if no Polygroup layer is found
*/
DYNAMICMESH_API const FDynamicMeshPolygroupAttribute* FindPolygroupLayerByName(const FDynamicMesh3& Mesh, FName Name);
/**
* @return index of the first Layer with the given FName in Mesh AttributeSet, or -1 if not found
*/
DYNAMICMESH_API int32 FindPolygroupLayerIndexByName(const FDynamicMesh3& Mesh, FName Name);
/**
* @return index of Layer in Mesh AttributeSet, or -1 if not found
*/
DYNAMICMESH_API int32 FindPolygroupLayerIndex(const FDynamicMesh3& Mesh, const FDynamicMeshPolygroupAttribute* Layer);
/**
* @return Compute the upper bound of the group IDs for the given layer (one greater than the highest group ID)
*/
DYNAMICMESH_API int32 ComputeGroupIDBound(const FDynamicMesh3& Mesh, const FDynamicMeshPolygroupAttribute* Layer);
/**
* @return unique group layer name derived from BaseName by appending a numeric suffix in the form _0, _1, etc
*/
DYNAMICMESH_API FString MakeUniqueGroupLayerName(const FDynamicMesh3& Mesh, FString BaseName);
} // end namespace Geometry
} // end namespace UE