// Copyright Epic Games, Inc. All Rights Reserved. #include "Dataflow/ChaosFleshIsolateComponentNode.h" #include UE_INLINE_GENERATED_CPP_BY_NAME(ChaosFleshIsolateComponentNode) void FIsolateComponentNode::Evaluate(UE::Dataflow::FContext& Context, const FDataflowOutput* Out) const { if (Out->IsA(&Collection)) { FManagedArrayCollection InCollection = GetValue(Context, &Collection); TArray DeleteList; TManagedArray* Indices = InCollection.FindAttribute("Indices", FGeometryCollection::FacesGroup); TManagedArray*FaceVisibility = InCollection.FindAttribute("Visible", FGeometryCollection::FacesGroup); TManagedArray* FaceStart = InCollection.FindAttribute("FaceStart", FGeometryCollection::GeometryGroup); TManagedArray* FaceCount = InCollection.FindAttribute("FaceCount", FGeometryCollection::GeometryGroup); if (Indices && FaceVisibility && FaceStart && FaceCount) { FaceVisibility->Fill(false); TSet GeometrySet; TArray StrArray; TargetGeometryIndex.ParseIntoArray(StrArray, *FString(" ")); for (FString GeometryIdx : StrArray) { if (GeometryIdx.Len() && FCString::IsNumeric(*GeometryIdx)) { GeometrySet.Add(FCString::Atoi(*GeometryIdx)); } } for (TSet::TConstIterator It = GeometrySet.CreateConstIterator(); It; ++It) { for (int32 FaceIdx = (*FaceStart)[*It]; FaceIdx < (*FaceStart)[*It] + (*FaceCount)[*It]; FaceIdx++) { (*FaceVisibility)[FaceIdx] = true; DeleteList.Add(FaceIdx); } } if (bDeleteHiddenFaces) { InCollection.RemoveElements(FGeometryCollection::FacesGroup, DeleteList); } } SetValue(Context, MoveTemp(InCollection), &Collection); } }