72 lines
1.7 KiB
C++
72 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Dataflow/DataflowEngine.h"
|
|
#include "Dataflow/DataflowSelection.h"
|
|
#include "DynamicMesh/DynamicMesh3.h"
|
|
#include "DynamicMeshProcessor.h"
|
|
|
|
#include "MeshBooleanNodes.generated.h"
|
|
|
|
class UDynamicMesh;
|
|
class UMaterialInterface;
|
|
|
|
|
|
UENUM(BlueprintType)
|
|
enum class EMeshBooleanOperationEnum : uint8
|
|
{
|
|
Dataflow_MeshBoolean_Union UMETA(DisplayName = "Union"),
|
|
Dataflow_MeshBoolean_Intersect UMETA(DisplayName = "Intersect"),
|
|
Dataflow_MeshBoolean_Difference UMETA(DisplayName = "Difference"),
|
|
//~~~
|
|
//256th entry
|
|
Dataflow_Max UMETA(Hidden)
|
|
};
|
|
|
|
/**
|
|
*
|
|
* Mesh boolean (Union, Intersect, Difference) between two meshes
|
|
*
|
|
*/
|
|
USTRUCT()
|
|
struct FMeshBooleanDataflowNode : public FDataflowNode
|
|
{
|
|
GENERATED_USTRUCT_BODY()
|
|
DATAFLOW_NODE_DEFINE_INTERNAL(FMeshBooleanDataflowNode, "MeshBoolean", "Mesh|Utilities", "")
|
|
DATAFLOW_NODE_RENDER_TYPE("SurfaceRender",FName("FDynamicMesh3"), "Mesh")
|
|
|
|
public:
|
|
|
|
FMeshBooleanDataflowNode(const UE::Dataflow::FNodeParameters& InParam, FGuid InGuid = FGuid::NewGuid());
|
|
|
|
private:
|
|
/** Boolean operation */
|
|
UPROPERTY(EditAnywhere, Category = "Boolean");
|
|
EMeshBooleanOperationEnum Operation = EMeshBooleanOperationEnum::Dataflow_MeshBoolean_Intersect;
|
|
|
|
/** Mesh input */
|
|
UPROPERTY(meta = (DataflowInput, DataflowIntrinsic))
|
|
TObjectPtr<UDynamicMesh> Mesh1;
|
|
|
|
/** Mesh input */
|
|
UPROPERTY(meta = (DataflowInput, DataflowIntrinsic))
|
|
TObjectPtr<UDynamicMesh> Mesh2;
|
|
|
|
/** Output mesh */
|
|
UPROPERTY(meta = (DataflowOutput))
|
|
TObjectPtr<UDynamicMesh> Mesh;
|
|
|
|
virtual void Evaluate(UE::Dataflow::FContext& Context, const FDataflowOutput* Out) const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace UE::Dataflow
|
|
{
|
|
void MeshBooleanNodes();
|
|
}
|
|
|