Add selection outline post-process setup (material pending)
- PostProcessComponent on Pawn (unbound, applies to entire scene) - Auto-loads M_PS_Editor_SelectionOutline material at BeginPlay - Removed debug bounding box from Tick - Custom depth stencil already toggled on selected actors - Material needs to be created in UE editor (edge detection on CustomStencil) - Instructions: use TexCoord + Constant2Vector offsets for 4-neighbor sampling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,39 +4,44 @@ description: Runtime editor plugin for UE 5.5 - object placement, scene editing,
|
|||||||
type: project
|
type: project
|
||||||
---
|
---
|
||||||
|
|
||||||
PS_Editor is a runtime editor plugin for Unreal Engine 5.5 that will be integrated into the PROSERVE project.
|
PS_Editor is a runtime editor plugin for Unreal Engine 5.5 for the PROSERVE project.
|
||||||
|
|
||||||
**Why:** Enable runtime scene editing in packaged builds - place objects, configure properties, define scenarios, manipulate splines, modify lighting, and save/load scenes as JSON.
|
|
||||||
|
|
||||||
Key decisions:
|
Key decisions:
|
||||||
- UI: UMG driven by C++ (Slate)
|
- UI: UMG driven by C++ (Slate)
|
||||||
- Gizmos: Custom actor with BasicShapes + unlit material (InteractiveToolsFramework is editor-only)
|
- Gizmos: Custom actor with BasicShapes + unlit material (ITF is editor-only)
|
||||||
- Serialization: JSON via Json/JsonUtilities modules (future)
|
- Serialization: JSON via Json/JsonUtilities (FJsonObjectConverter)
|
||||||
- Naming: PS_Editor_ prefix on all files/classes
|
- Naming: PS_Editor_ prefix on all files/classes
|
||||||
- Plugin path: Unreal/Plugins/PS_Editor/
|
- Plugin path: Unreal/Plugins/PS_Editor/
|
||||||
- AZERTY keyboard layout: arrows + A/Q for movement, E/R/T for modes
|
- AZERTY keyboard: arrows + A/Q for movement, E/R/T for modes
|
||||||
|
|
||||||
## Completed Phases
|
## Completed Phases
|
||||||
|
|
||||||
### Phase 1 - GameMode + Camera
|
### Phase 1 - GameMode + Camera
|
||||||
- PS_Editor_GameMode, PS_Editor_Pawn, PS_Editor_PlayerController, PS_Editor_HUD
|
|
||||||
- Camera: Fly (RMB), Pan (LMB drag), Orbit (Alt+LMB / MMB)
|
- Camera: Fly (RMB), Pan (LMB drag), Orbit (Alt+LMB / MMB)
|
||||||
- Movement: arrows + A (up) / Q (down)
|
- Movement: arrows + A (up) / Q (down)
|
||||||
|
|
||||||
### Phase 2 - Selection + Transform + Undo
|
### Phase 2 - Selection + Transform + Undo
|
||||||
- SelectionManager: raycast click-to-select, Ctrl+click multi-select, Movable actors only
|
- Click-to-select (Movable actors only), Ctrl+click multi-select
|
||||||
- Gizmo: custom actor with colored arrows (R/G/B), cones, SDPG_Foreground, constant screen size
|
- Custom gizmo (R/G/B arrows + cones, SDPG_Foreground, constant screen size)
|
||||||
- Translate/Rotate/Scale via gizmo drag, hotkeys E/R/T
|
- Translate/Rotate/Scale via gizmo drag, hotkeys E/R/T
|
||||||
- Snap to ground (End key), soft-delete (Delete key)
|
- Snap to ground (End), soft-delete (Delete + confirmation dialog)
|
||||||
- Undo/Redo system: custom UndoManager, Ctrl+Z / Ctrl+Y, 50 action stack
|
- Undo/Redo (Ctrl+Z/Y, 50 action stack)
|
||||||
- Properties panel: editable Location/Rotation/Scale fields
|
- Properties panel + toolbar UI
|
||||||
- Toolbar: mode buttons + snap ground
|
- Material: M_PS_Editor_Gizmo (Unlit, "Color" param, Translucent, Disable Depth Test)
|
||||||
- Material: M_PS_Editor_Gizmo (Unlit, Vector Parameter "Color" → Emissive, Translucent, Disable Depth Test)
|
|
||||||
|
|
||||||
## Next: Phase 3 - Object Spawning
|
### Phase 3 - Object Spawning
|
||||||
- Catalog/list of objects to place
|
- SpawnableComponent: marker on BPs (name, category, thumbnail)
|
||||||
- Drag & drop or click to spawn
|
- SpawnCatalog DataAsset + Factory for easy creation
|
||||||
- Duplication of existing objects
|
- SpawnManager: spawns in front of camera, tracks all spawned actors
|
||||||
|
- Catalogue UI: thumbnail cards, click to spawn, grouped by category
|
||||||
|
- CaptureAllThumbnails on DataAsset: auto-generates from UE thumbnails
|
||||||
|
- Spawn undo/redo, auto-deselect hidden actors
|
||||||
|
|
||||||
## Next: Phase 4 - JSON Serialization
|
### Phase 4 - JSON Serialization
|
||||||
- Save/load scenes as JSON
|
- SceneData USTRUCT (Version, SceneName, Timestamp, Actors[ClassPath, Location, Rotation, Scale])
|
||||||
|
- SceneSerializer: Save/Load/Clear/GetSavedSceneNames
|
||||||
|
- Files in Saved/PS_Editor/Scenes/{name}.json
|
||||||
|
- UI: Save field + button, New Scene, saved scenes list with click-to-load
|
||||||
|
|
||||||
|
## Next: Phase 5 - Advanced Editing
|
||||||
|
- Splines, lighting, AI characters, property editing
|
||||||
|
|||||||
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
#include "PS_Editor_Pawn.h"
|
#include "PS_Editor_Pawn.h"
|
||||||
#include "Camera/CameraComponent.h"
|
#include "Camera/CameraComponent.h"
|
||||||
#include "GameFramework/SpringArmComponent.h"
|
#include "GameFramework/SpringArmComponent.h"
|
||||||
|
#include "Components/PostProcessComponent.h"
|
||||||
#include "EnhancedInputComponent.h"
|
#include "EnhancedInputComponent.h"
|
||||||
#include "EnhancedInputSubsystems.h"
|
#include "EnhancedInputSubsystems.h"
|
||||||
#include "InputAction.h"
|
#include "InputAction.h"
|
||||||
@@ -31,11 +32,29 @@ APS_Editor_Pawn::APS_Editor_Pawn()
|
|||||||
|
|
||||||
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
|
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
|
||||||
Camera->SetupAttachment(SpringArm);
|
Camera->SetupAttachment(SpringArm);
|
||||||
|
|
||||||
|
OutlinePostProcess = CreateDefaultSubobject<UPostProcessComponent>(TEXT("OutlinePostProcess"));
|
||||||
|
OutlinePostProcess->SetupAttachment(RootScene);
|
||||||
|
OutlinePostProcess->bUnbound = true; // Apply to entire scene
|
||||||
}
|
}
|
||||||
|
|
||||||
void APS_Editor_Pawn::BeginPlay()
|
void APS_Editor_Pawn::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
|
|
||||||
|
// Load outline post-process material
|
||||||
|
UMaterialInterface* OutlineMat = LoadObject<UMaterialInterface>(
|
||||||
|
nullptr, TEXT("/PS_Editor/M_PS_Editor_SelectionOutline.M_PS_Editor_SelectionOutline"));
|
||||||
|
if (OutlineMat && OutlinePostProcess)
|
||||||
|
{
|
||||||
|
OutlinePostProcess->Settings.WeightedBlendables.Array.Add(FWeightedBlendable(1.0f, OutlineMat));
|
||||||
|
UE_LOG(LogTemp, Log, TEXT("PS_Editor: Selection outline material loaded"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UE_LOG(LogTemp, Warning, TEXT("PS_Editor: Outline material /PS_Editor/M_PS_Editor_SelectionOutline not found. "
|
||||||
|
"Create a Post Process material in Plugins/PS_Editor/Content/"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APS_Editor_Pawn::Tick(float DeltaTime)
|
void APS_Editor_Pawn::Tick(float DeltaTime)
|
||||||
@@ -53,22 +72,6 @@ void APS_Editor_Pawn::Tick(float DeltaTime)
|
|||||||
UpdateGizmoHover();
|
UpdateGizmoHover();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw debug bounding box around selected actors
|
|
||||||
if (APS_Editor_PlayerController* EditorPC = Cast<APS_Editor_PlayerController>(PC))
|
|
||||||
{
|
|
||||||
if (UPS_Editor_SelectionManager* SM = EditorPC->GetSelectionManager())
|
|
||||||
{
|
|
||||||
for (const TWeakObjectPtr<AActor>& Weak : SM->GetSelectedActors())
|
|
||||||
{
|
|
||||||
if (AActor* Actor = Weak.Get())
|
|
||||||
{
|
|
||||||
FVector Origin, Extent;
|
|
||||||
Actor->GetActorBounds(false, Origin, Extent);
|
|
||||||
DrawDebugBox(GetWorld(), Origin, Extent, FColor::Orange, false, -1.0f, 0, 2.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
class UCameraComponent;
|
class UCameraComponent;
|
||||||
class USpringArmComponent;
|
class USpringArmComponent;
|
||||||
|
class UPostProcessComponent;
|
||||||
class UInputAction;
|
class UInputAction;
|
||||||
class UInputMappingContext;
|
class UInputMappingContext;
|
||||||
|
|
||||||
@@ -73,6 +74,9 @@ protected:
|
|||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera")
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera")
|
||||||
TObjectPtr<UCameraComponent> Camera;
|
TObjectPtr<UCameraComponent> Camera;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera")
|
||||||
|
TObjectPtr<UPostProcessComponent> OutlinePostProcess;
|
||||||
|
|
||||||
// ---- Camera Settings ----
|
// ---- Camera Settings ----
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Fly")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Fly")
|
||||||
|
|||||||
Reference in New Issue
Block a user