Files
UnrealEngineUWP/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsEditorModule/Public/SmartObjectAssetToolkit.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

56 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Tools/BaseAssetToolkit.h"
#include "AdvancedPreviewScene.h"
class FEditorViewportClient;
class UAssetEditor;
class SMARTOBJECTSEDITORMODULE_API FSmartObjectAssetToolkit : public FBaseAssetToolkit, public FGCObject
{
public:
explicit FSmartObjectAssetToolkit(UAssetEditor* InOwningAssetEditor);
virtual TSharedPtr<FEditorViewportClient> CreateEditorViewportClient() const override;
protected:
virtual void PostInitAssetEditor() override;
virtual void RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
virtual void OnClose() override;
virtual void AddReferencedObjects(FReferenceCollector& Collector) override;
virtual FString GetReferencerName() const override
{
return TEXT("FSmartObjectAssetToolkit");
}
private:
/** Callback to detect changes in number of slot to keep gizmos in sync. */
void OnPropertyChanged(UObject* ObjectBeingModified, FPropertyChangedEvent& PropertyChangedEvent) const;
/** Creates a tab allowing the user to select a mesh or actor template to spawn in the preview scene. */
TSharedRef<SDockTab> SpawnTab_PreviewSettings(const FSpawnTabArgs& Args);
TSharedRef<SDockTab> SpawnTab_SceneViewport(const FSpawnTabArgs& Args);
/** Additional Tab to select mesh/actor to add a 3D preview in the scene. */
static const FName PreviewSettingsTabID;
static const FName SceneViewportTabID;
/** Scene in which the 3D preview of the asset lives. */
TUniquePtr<FAdvancedPreviewScene> AdvancedPreviewScene;
/** Typed pointer to the custom ViewportClient created by the toolkit. */
mutable TSharedPtr<class FSmartObjectAssetEditorViewportClient> SmartObjectViewportClient;
/** Object path of an actor picked from the current level Editor to spawn a preview in the scene. */
FString PreviewActorObjectPath;
/** Object path of a mesh selected from the content to spawn a preview in the scene. */
FString PreviewMeshObjectPath;
/** Class of the template actor to spawn a preview in the scene. */
TWeakObjectPtr<const UClass> PreviewActorClass;
};