Files
UnrealEngineUWP/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/MeshModelingToolsExp/Public/BakeTransformTool.h
lonnie li 6584198283 InteractiveToolsFramework: Remove unnecessary target interface functions from MultiSelectionTool.
ModelingTools: Add UMultiSelectionMeshEditingTool to hold common interface requirements and functions that pertain to modeling mode MultiSelectionTools.

#rb semion.piskarev
#rnx
#jira none
#preflight 619c66d5c3287aab27e12c73

#ROBOMERGE-AUTHOR: lonnie.li
#ROBOMERGE-SOURCE: CL 18269697 in //UE5/Release-5.0/... via CL 18269713
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18269717 by lonnie li in ue5-release-engine-test branch]
2021-11-23 09:42:40 -05:00

97 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "BaseTools/MultiSelectionMeshEditingTool.h"
#include "InteractiveToolBuilder.h"
#include "MeshOpPreviewHelpers.h"
#include "DynamicMesh/DynamicMesh3.h"
#include "BaseTools/SingleClickTool.h"
#include "BakeTransformTool.generated.h"
// predeclarations
struct FMeshDescription;
class UDynamicMeshComponent;
/**
*
*/
UCLASS()
class MESHMODELINGTOOLSEXP_API UBakeTransformToolBuilder : public UMultiSelectionMeshEditingToolBuilder
{
GENERATED_BODY()
public:
virtual UMultiSelectionMeshEditingTool* CreateNewTool(const FToolBuilderState& SceneState) const override;
};
UENUM()
enum class EBakeScaleMethod : uint8
{
// bake all scale information, so the component has scale of 1 on all axes
BakeFullScale,
// bake the non-uniform scale, so the component has a uniform scale
BakeNonuniformScale,
// do not bake any scaling
DoNotBakeScale
};
/**
* Standard properties
*/
UCLASS()
class MESHMODELINGTOOLSEXP_API UBakeTransformToolProperties : public UInteractiveToolPropertySet
{
GENERATED_BODY()
public:
UBakeTransformToolProperties();
/** Bake rotation */
UPROPERTY(EditAnywhere, Category = Options)
bool bBakeRotation = true;
/** Bake scale */
UPROPERTY(EditAnywhere, Category = Options)
EBakeScaleMethod BakeScale = EBakeScaleMethod::BakeFullScale;
/** Recenter pivot after baking transform */
UPROPERTY(EditAnywhere, Category = Options)
bool bRecenterPivot = false;
};
/**
* Simple tool to bake scene transform on meshes into the mesh assets
*/
UCLASS()
class MESHMODELINGTOOLSEXP_API UBakeTransformTool : public UMultiSelectionMeshEditingTool
{
GENERATED_BODY()
public:
UBakeTransformTool();
virtual void Setup() override;
virtual void Shutdown(EToolShutdownType ShutdownType) override;
virtual bool HasCancel() const override { return true; }
virtual bool HasAccept() const override { return true; }
protected:
UPROPERTY()
TObjectPtr<UBakeTransformToolProperties> BasicProperties;
protected:
TArray<int> MapToFirstOccurrences;
void UpdateAssets();
};