You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Add support for Tools to provide an "output" selection. Add UGeometrySelectionManager::SetSelectionForComponent() which can set an explicit externally-provided selection. FBaseDynamicMeshSelector::UpdateSelectionFromSelection() now supports selection conversion when available and requested (is used to implement SetSelectionForComponent). New GeometrySelectionUtil functions InitializeSelectionFromTriangles() and ConvertSelection() are used to implement this (note: only Triangles->other conversion is currently supported). Add HaveAvailableGeometrySelection() and SetToolOutputGeometrySelectionForTarget() in StoredMeshSelectionUtil.h, this is the top-level function that Tools can use to set an Output selection. ExtrudeMeshSelectionTool now emits output selection. Update EditMeshPolygonsTool to use new Selection system and allow individual operations to be utilized as standalone Tools. Convert EditMeshPolygonsTool to be a USingleTargetWithSelectionTool, use FGeometrySelection to initialize selection. Add bTerminateOnPendingActionComplete flag, which is set when Tool is directly initialized to a specific operation, and forces tool to shut down when operation completes. This allows it to be used to more cleanly implement multiple action buttons in Modeling UI. When in this mode, selection panels are not shown. On Shutdown, now emits an "output" selection which GeometrySelectionManager can use to provide new selection to user. Update UPolygonSelectionMechanic Set/Get selection APIs to use FGeometrySelection instead of UPersistentMeshSelection. port UVProjectionTool to derive from USingleTargetWithSelectionTool, use FGeometrySelection to initialize target ROI deprecate UPersistentMeshSelection and related functions in StoredMeshSelectionUtil.h. Deprecate Tool Input Selection APIs in USingleSelectionMeshEditingTool and Builder. Repurpose old ModelingMode-level PolyModel tab operations for new Selection Tools UI, now support Inset, Outset, Cut Faces, Insert Edge Loop, PushPull, and Bevel. #rb none #preflight 63c84fa2b065224750b9831f [CL 23766643 by ryan schmidt in ue5-main branch]
105 lines
3.7 KiB
C++
105 lines
3.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "SingleSelectionTool.h"
|
|
#include "InteractiveToolBuilder.h"
|
|
#include "SingleSelectionMeshEditingTool.generated.h"
|
|
|
|
class USingleSelectionMeshEditingTool;
|
|
class UDEPRECATED_PersistentMeshSelection;
|
|
|
|
/**
|
|
* USingleSelectionMeshEditingToolBuilder is a base tool builder for single
|
|
* selection tools that define a common set of ToolTarget interfaces required
|
|
* for editing meshes.
|
|
*/
|
|
UCLASS(Transient, Abstract)
|
|
class MODELINGCOMPONENTS_API USingleSelectionMeshEditingToolBuilder : public UInteractiveToolWithToolTargetsBuilder
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
/** @return true if a single mesh source can be found in the active selection */
|
|
virtual bool CanBuildTool(const FToolBuilderState& SceneState) const override;
|
|
|
|
/** @return new Tool instance initialized with selected mesh source */
|
|
virtual UInteractiveTool* BuildTool(const FToolBuilderState& SceneState) const override;
|
|
|
|
/** @return new Tool instance. Override this in subclasses to build a different Tool class type */
|
|
virtual USingleSelectionMeshEditingTool* CreateNewTool(const FToolBuilderState& SceneState) const PURE_VIRTUAL(USingleSelectionMeshEditingToolBuilder::CreateNewTool, return nullptr; );
|
|
|
|
/** Called by BuildTool to configure the Tool with the input MeshSource based on the SceneState */
|
|
virtual void InitializeNewTool(USingleSelectionMeshEditingTool* Tool, const FToolBuilderState& SceneState) const;
|
|
|
|
/** @return true if this Tool would like access to an available Input Selection object */
|
|
UE_DEPRECATED(5.2, "UPersistentMeshSelection and related functions are deprecated")
|
|
virtual bool WantsInputSelectionIfAvailable() const { return false; }
|
|
|
|
protected:
|
|
virtual const FToolTargetTypeRequirements& GetTargetRequirements() const override;
|
|
};
|
|
|
|
|
|
/**
|
|
* Single Selection Mesh Editing tool base class.
|
|
*/
|
|
UCLASS()
|
|
class MODELINGCOMPONENTS_API USingleSelectionMeshEditingTool : public USingleSelectionTool
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
virtual void Shutdown(EToolShutdownType ShutdownType) override;
|
|
virtual void OnShutdown(EToolShutdownType ShutdownType);
|
|
|
|
virtual void SetWorld(UWorld* World);
|
|
virtual UWorld* GetTargetWorld();
|
|
|
|
protected:
|
|
UPROPERTY()
|
|
TWeakObjectPtr<UWorld> TargetWorld = nullptr;
|
|
|
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
|
|
//
|
|
// Mesh Selection support
|
|
//
|
|
|
|
public:
|
|
/**
|
|
* Set a Selection for the Tool to use. This should be called before tool Setup() (ie in the ToolBuilder)
|
|
* to allow the Tool to configure it's behavior based on the Selection (which may or may-not exist).
|
|
* If the Tool requires a Selection, this needs to be handled at the Builder level.
|
|
*/
|
|
UE_DEPRECATED(5.2, "UPersistentMeshSelection and related functions are deprecated")
|
|
virtual void SetInputSelection(const UDEPRECATED_PersistentMeshSelection* SelectionIn)
|
|
{
|
|
InputSelection_DEPRECATED = SelectionIn;
|
|
}
|
|
|
|
/** @return true if an InputSelection is available */
|
|
UE_DEPRECATED(5.2, "UPersistentMeshSelection and related functions are deprecated")
|
|
virtual bool HasInputSelection() const
|
|
{
|
|
return InputSelection_DEPRECATED != nullptr;
|
|
}
|
|
|
|
/** @return the input Selection, or nullptr if one was not configured */
|
|
UE_DEPRECATED(5.2, "UPersistentMeshSelection and related functions are deprecated")
|
|
virtual const UDEPRECATED_PersistentMeshSelection* GetInputSelection() const
|
|
{
|
|
return InputSelection_DEPRECATED;
|
|
}
|
|
|
|
protected:
|
|
|
|
/**
|
|
* (optional) Mesh Selection provided on Tool Input. This should never be modified after the Tool's Setup() is called
|
|
*/
|
|
UE_DEPRECATED(5.2, "UPersistentMeshSelection and related functions are deprecated")
|
|
UPROPERTY()
|
|
TObjectPtr<const UDEPRECATED_PersistentMeshSelection> InputSelection_DEPRECATED = nullptr;
|
|
|
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
};
|