Files
UnrealEngineUWP/Engine/Plugins/Experimental/GeometryCollectionPlugin/Source/GeometryCollectionNodes/Private/Dataflow/GeometryCollectionSkeletalMeshNodes.cpp
Brice Criswell ade8c3223c GeometryCollection : Append Skeleton
- Added nodes to append a skeleton to the geometry collection.
#rb none
#fyi cedric.caillaud
#preflight 632b46c8e23e50651beea2a3

[CL 22117623 by Brice Criswell in ue5-main branch]
2022-09-21 13:57:36 -04:00

35 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Dataflow/GeometryCollectionSkeletalMeshNodes.h"
#include "Engine/SkeletalMesh.h"
#include "GeometryCollection/GeometryCollectionObject.h"
#include "GeometryCollection/ManagedArrayCollection.h"
#include "GeometryCollection/GeometryCollection.h"
#include "GeometryCollection/GeometryCollectionEngineConversion.h"
namespace Dataflow
{
void GeometryCollectionSkeletalMeshNodes()
{
DATAFLOW_NODE_REGISTER_CREATION_FACTORY(FSkeletonToCollectionDataflowNode);
}
}
void FSkeletonToCollectionDataflowNode::Evaluate(Dataflow::FContext& Context, const FDataflowOutput* Out) const
{
if (Out->IsA<DataType>(&Collection))
{
DataType OutCollection;
TObjectPtr<const USkeleton> SkeletonValue = GetValue<TObjectPtr<const USkeleton>>(Context, &Skeleton);
if (SkeletonValue)
{
FGeometryCollectionEngineConversion::AppendSkeleton(SkeletonValue.Get(), FTransform::Identity, &OutCollection);
}
SetValue<DataType>(Context, OutCollection, &Collection);
}
}