You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
+ added component visualizer for smart object allowing visualization of the associated definition + added dedicated AssetEditor, UserSettings, AssetToolkit, AssetTypeActions and ViewportClient + updated SmartObjectsEditorModule to register AssetType actions and visualizers #preflight 61eecfc18f38611657eddbb7 #ROBOMERGE-AUTHOR: yoan.stamant #ROBOMERGE-SOURCE: CL 18709637 in //UE5/Release-5.0/... via CL 18709664 via CL 18709798 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472) [CL 18709831 by yoan stamant in ue5-main branch]
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SmartObjectComponentVisualizer.h"
|
|
#include "SmartObjectComponent.h"
|
|
#include "SceneManagement.h"
|
|
|
|
void FSmartObjectComponentVisualizer::DrawVisualization( const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI )
|
|
{
|
|
const USmartObjectComponent* SOComp = Cast<const USmartObjectComponent>(Component);
|
|
if (SOComp == nullptr)
|
|
{
|
|
return;
|
|
}
|
|
|
|
const USmartObjectDefinition* Definition = SOComp->GetDefinition();
|
|
if (Definition == nullptr)
|
|
{
|
|
return;
|
|
}
|
|
|
|
FColor Color = FColor::White;
|
|
|
|
const FTransform OwnerLocalToWorld = SOComp->GetComponentTransform();
|
|
for (int32 i = 0; i < Definition->GetSlots().Num(); ++i)
|
|
{
|
|
constexpr float DebugCylinderRadius = 40.f;
|
|
TOptional<FTransform> Transform = Definition->GetSlotTransform(OwnerLocalToWorld, FSmartObjectSlotIndex(i));
|
|
if (!Transform.IsSet())
|
|
{
|
|
continue;
|
|
}
|
|
#if WITH_EDITORONLY_DATA
|
|
Color = Definition->GetSlots()[i].DEBUG_DrawColor;
|
|
#endif
|
|
|
|
const FVector Location = Transform.GetValue().GetLocation();
|
|
|
|
DrawDirectionalArrow(PDI, Transform.GetValue().ToMatrixNoScale(), Color, 2.f*DebugCylinderRadius, /*ArrowSize*/1.f, SDPG_World, /*Thickness*/1.0f);
|
|
DrawCircle(PDI, Location, FVector::XAxisVector, FVector::YAxisVector, Color, DebugCylinderRadius, /*NumSides*/64, SDPG_World, /*Thickness*/2.f);
|
|
}
|
|
}
|