Files
UnrealEngineUWP/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsEditorModule/Private/SmartObjectComponentVisualizer.h
mikko mononen c06beb8571 SmartObject improvements
- Fixed hashing when adding shared fragment for smart object slot definition
- Added per slot Runtime Tags
- Added common event handling for Smart Object and Slot changes and events
- Added annotations, which are slot definition data that has visualization
- Added linked slot annotation which allows behavior reuse on slots
- Added editor only ID for each slot so that they can be identified during edits
- Added SmartObject slot reference type that can be used to reference other slots in the Smart Object
- Changed Smart Object bDisable to bEnabled
- Added separate enabled state for slots
- Changed Smart Object disable to send an event, not forcefully unclaim
- Added more visualization support for Smart Object editor (canvas, visualize annotations)
- Changed Smart Object editor to use the commonly transform for slots
- Remove Smart Object Component instance from the asset editor as it was not needed

#rb Stephen.Holmes
#preflight 6360f0cf63608aee36e01ba5

[CL 22888712 by mikko mononen in ue5-main branch]
2022-11-01 15:11:25 -04:00

50 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ComponentVisualizer.h"
class USmartObjectComponent;
class USmartObjectDefinition;
class USmartObjectAssetEditorTool;
/**
* Hit proxy for Smart Object slots.
*/
struct SMARTOBJECTSEDITORMODULE_API HSmartObjectSlotProxy : public HComponentVisProxy
{
DECLARE_HIT_PROXY();
HSmartObjectSlotProxy(const UActorComponent* InComponent, const FGuid InSlotID)
: HComponentVisProxy(InComponent, HPP_Foreground)
, SlotID(InSlotID)
{}
virtual EMouseCursor::Type GetMouseCursor() override
{
return EMouseCursor::CardinalCross;
}
FGuid SlotID;
};
/**
* Helper functions to draw Smart Object definition visualization.
*/
namespace UE::SmartObjects::Editor
{
void Draw(const USmartObjectDefinition& Definition, TConstArrayView<FGuid> Selection, const FTransform& OwnerLocalToWorld, const FSceneView& View, FPrimitiveDrawInterface& PDI);
void DrawCanvas(const USmartObjectDefinition& Definition, TConstArrayView<FGuid> Selection, const FTransform& OwnerLocalToWorld, const FSceneView& View, FCanvas& Canvas);
}; // UE::SmartObjects::Editor
/**
* Visualizer for SmartObjectComponent
*/
class SMARTOBJECTSEDITORMODULE_API FSmartObjectComponentVisualizer : public FComponentVisualizer
{
protected:
virtual void DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI) override;
virtual void DrawVisualizationHUD(const UActorComponent* Component, const FViewport* Viewport, const FSceneView* View, FCanvas* Canvas) override;
};