This commit is contained in:
2025-04-18 18:17:02 +08:00
parent 80fdce96b2
commit e15eafe5d4
18 changed files with 259 additions and 493 deletions

View File

@@ -18,5 +18,5 @@ public:
// The asset that owns this graph
UPROPERTY()
class UDismembermentGraphAsset* OwningAsset;
TObjectPtr<class UDismembermentGraphAsset> OwningAsset;
};

View File

@@ -0,0 +1,51 @@
#pragma once
#include "CoreMinimal.h"
#include "EdGraphUtilities.h"
class UDismembermentGraphNode;
class SDismembermentGraphNode;
/**
* Dismemberment graph node factory
* Used to create visual representations of dismemberment graph nodes
*/
class FDismembermentGraphNodeFactory : public FGraphPanelNodeFactory
{
public:
// Constructor
FDismembermentGraphNodeFactory();
FDismembermentGraphNodeFactory(UClass* InNodeClass, const FText& InDisplayName, const FText& InTooltip);
// FGraphPanelNodeFactory interface
virtual TSharedPtr<SGraphNode> CreateNode(UEdGraphNode* Node) const override;
// End of interface
private:
// Node class
UClass* NodeClass;
// Display name
FText DisplayName;
// Tooltip
FText Tooltip;
};
/**
* Dismemberment schema action - New node
* Used to create new nodes in the context menu
*/
class FDismembermentSchemaAction_NewNode : public FEdGraphSchemaAction
{
public:
// Constructor
FDismembermentSchemaAction_NewNode(const FText& InNodeCategory, const FText& InMenuDesc, const FText& InToolTip, const int32 InGrouping);
// Perform action
virtual UEdGraphNode* PerformAction(UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) override;
// Node class
TSubclassOf<UDismembermentGraphNode> NodeClass;
};

View File

@@ -21,7 +21,7 @@ public:
virtual ~FFLESHEditor();
// Initialize the editor
void InitFLESHEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost>& InitToolkitHost);
void InitFLESHEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost>& InitToolkitHost, UObject* InObject);
// FAssetEditorToolkit interface
virtual void RegisterTabSpawners(const TSharedRef<FTabManager>& TabManager) override;

View File

@@ -7,6 +7,9 @@
#include "Widgets/Layout/SBox.h"
#include "Widgets/Layout/SGridPanel.h"
// Define matrix change delegate type
DECLARE_DELEGATE_OneParam(FOnMatrixChanged, const FMatrix&);
/**
* Matrix input widget for the FLESH editor
* Allows inputting transformation matrices for precise cutting operations
@@ -67,6 +70,3 @@ private:
/** Updates the UI from the matrix value */
void UpdateUI();
};
/** Delegate for matrix value changes */
DECLARE_DELEGATE_OneParam(FOnMatrixChanged, const FMatrix&);