Files
UnrealEngineUWP/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingComponents/Private/PropertySets/PolygroupLayersProperties.cpp
Ryan Schmidt 2a8984fe77 MeshModelingToolset
- add support for VertexColor shader mode in EMeshEditingMaterialModes, handle in sculpt tools
- MeshSculptToolBase: add ability to hide view and brushop properties, add ability to show surface or volumetric indicator, add tracking of last-hit triangle ID
- add UPolygroupLayersProperties, standard property set for listing and picking from available Polygroup layers for a mesh
- add MeshGroupPaintTool, uses above extensions to allow for painting per-triangle integer polygroups
#rb none
#rnx
#jira none

[CL 14861461 by Ryan Schmidt in ue5-main branch]
2020-12-04 19:51:25 -04:00

43 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "PropertySets/PolygroupLayersProperties.h"
#include "DynamicMesh3.h"
#include "DynamicMeshAttributeSet.h"
void UPolygroupLayersProperties::InitializeGroupLayers(const FDynamicMesh3* Mesh)
{
GroupLayersList.Add(TEXT("Default")); // always have standard group
if (Mesh->Attributes())
{
for (int32 k = 0; k < Mesh->Attributes()->NumPolygroupLayers(); k++)
{
FName Name = Mesh->Attributes()->GetPolygroupLayer(k)->GetName();
GroupLayersList.Add(Name.ToString());
}
}
if (GroupLayersList.Contains(ActiveGroupLayer.ToString()) == false) // discard restored value if it doesn't apply
{
ActiveGroupLayer = FName(GroupLayersList[0]);
}
}
bool UPolygroupLayersProperties::HasSelectedPolygroup() const
{
return ActiveGroupLayer != FName(GroupLayersList[0]);
}
void UPolygroupLayersProperties::SetSelectedFromPolygroupIndex(int32 Index)
{
if (Index < 0)
{
ActiveGroupLayer = FName(GroupLayersList[0]);
}
else
{
ActiveGroupLayer = FName(GroupLayersList[Index+1]);
}
}