You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb ryan.schmidt michael.balzer #rnx #jira none #preflight 61f435dd74510448a6865d14 #ROBOMERGE-AUTHOR: lonnie.li #ROBOMERGE-SOURCE: CL 18777332 in //UE5/Release-5.0/... via CL 18780413 via CL 18780555 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472) [CL 18780558 by lonnie li in ue5-main branch]
79 lines
1.8 KiB
C++
79 lines
1.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "BaseTools/MultiSelectionMeshEditingTool.h"
|
|
#include "InteractiveToolBuilder.h"
|
|
#include "PropertySets/CreateMeshObjectTypeProperties.h"
|
|
#include "SplitMeshesTool.generated.h"
|
|
|
|
class UMaterialInterface;
|
|
|
|
|
|
UCLASS()
|
|
class MESHMODELINGTOOLSEXP_API USplitMeshesToolBuilder : public UMultiSelectionMeshEditingToolBuilder
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
virtual UMultiSelectionMeshEditingTool* CreateNewTool(const FToolBuilderState& SceneState) const override;
|
|
|
|
protected:
|
|
virtual const FToolTargetTypeRequirements& GetTargetRequirements() const override;
|
|
};
|
|
|
|
|
|
|
|
UCLASS()
|
|
class MESHMODELINGTOOLSEXP_API USplitMeshesToolProperties : public UInteractiveToolPropertySet
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
UPROPERTY(EditAnywhere, Category = Options)
|
|
bool bTransferMaterials = true;
|
|
};
|
|
|
|
|
|
|
|
UCLASS()
|
|
class MESHMODELINGTOOLSEXP_API USplitMeshesTool : public UMultiSelectionMeshEditingTool
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
virtual void Setup() override;
|
|
virtual void OnShutdown(EToolShutdownType ShutdownType) override;
|
|
|
|
virtual bool HasCancel() const override { return true; }
|
|
virtual bool HasAccept() const override { return true; }
|
|
virtual bool CanAccept() const override;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<USplitMeshesToolProperties> BasicProperties;
|
|
|
|
UPROPERTY()
|
|
TObjectPtr<UCreateMeshObjectTypeProperties> OutputTypeProperties;
|
|
|
|
protected:
|
|
struct FSourceMeshInfo
|
|
{
|
|
UE::Geometry::FDynamicMesh3 Mesh;
|
|
TArray<UMaterialInterface*> Materials;
|
|
};
|
|
TArray<FSourceMeshInfo> SourceMeshes;
|
|
|
|
|
|
struct FComponentsInfo
|
|
{
|
|
bool bNoComponents;
|
|
TArray<UE::Geometry::FDynamicMesh3> Meshes;
|
|
TArray<TArray<UMaterialInterface*>> Materials;
|
|
TArray<FVector3d> Origins;
|
|
};
|
|
TArray<FComponentsInfo> SplitMeshes;
|
|
|
|
int32 NoSplitCount = 0;
|
|
|
|
void UpdateSplitMeshes();
|
|
};
|