This commit is contained in:
2025-04-18 18:42:53 +08:00
parent e15eafe5d4
commit 446eaf90d0
14 changed files with 357 additions and 2 deletions

View File

@@ -38,6 +38,9 @@ public class FLESH : ModuleRules
"ChaosCloth",
"ChaosNiagara",
"PhysicsControl",
"MeshDescription",
"StaticMeshDescription",
"DynamicMesh",
// ... add other public dependencies that you statically link with here ...
}
);

View File

@@ -56,6 +56,14 @@ public class FLESHEditor : ModuleRules
"EditorWidgets",
"Kismet",
"AdvancedPreviewScene",
"Projects",
"Niagara",
"NiagaraEditor",
"PhysicsCore",
"MeshDescription",
"StaticMeshDescription",
"DynamicMesh",
"GeometryScriptingCore",
// ... add private dependencies that you statically link with here ...
}
);

View File

@@ -0,0 +1,66 @@
#include "AnatomicalStructureBrush.h"
#include "Engine/SkeletalMesh.h"
#include "Engine/StaticMesh.h"
#include "Materials/MaterialInterface.h"
UAnatomicalStructureBrush::UAnatomicalStructureBrush()
{
// Initialize default values
BrushSettings.BrushType = EAnatomicalBrushType::Bone;
BrushSettings.BrushSize = 10.0f;
BrushSettings.BrushStrength = 0.5f;
BrushSettings.BrushFalloff = 0.5f;
BrushSettings.BrushMaterial = nullptr;
}
void UAnatomicalStructureBrush::Initialize(const FAnatomicalBrushSettings& InSettings)
{
BrushSettings = InSettings;
}
bool UAnatomicalStructureBrush::ApplyToSkeletalMesh(USkeletalMesh* TargetMesh, const FVector& Location, const FVector& Direction, FName BoneName)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
return false;
}
bool UAnatomicalStructureBrush::ApplyToStaticMesh(UStaticMesh* TargetMesh, const FVector& Location, const FVector& Direction)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
return false;
}
void UAnatomicalStructureBrush::SetBrushType(EAnatomicalBrushType BrushType)
{
BrushSettings.BrushType = BrushType;
}
void UAnatomicalStructureBrush::SetBrushSize(float Size)
{
BrushSettings.BrushSize = FMath::Clamp(Size, 0.1f, 100.0f);
}
void UAnatomicalStructureBrush::SetBrushStrength(float Strength)
{
BrushSettings.BrushStrength = FMath::Clamp(Strength, 0.0f, 1.0f);
}
FAnatomicalBrushSettings UAnatomicalStructureBrush::GetBrushSettings() const
{
return BrushSettings;
}
UStaticMesh* UAnatomicalStructureBrush::CreateAnatomicalStructure(const FVector& Location, const FVector& Direction, float Size)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
return nullptr;
}
void UAnatomicalStructureBrush::ApplyPhysicsProperties(UStaticMesh* Mesh)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -0,0 +1,6 @@
#include "DismembermentCompiler.h"
UDismembermentCompiler::UDismembermentCompiler()
{
// Initialize default values
}

View File

@@ -0,0 +1,6 @@
#include "DismembermentExecutor.h"
UDismembermentExecutor::UDismembermentExecutor()
{
// Initialize default values
}

View File

@@ -0,0 +1,8 @@
#include "DismembermentGraph/DismembermentGraph.h"
#include "DismembermentGraph/DismembermentGraphAsset.h"
UDismembermentGraph::UDismembermentGraph()
{
// Initialize default values
OwningAsset = nullptr;
}

View File

@@ -0,0 +1,48 @@
#include "DismembermentGraph/DismembermentGraphNode.h"
UDismembermentGraphNode::UDismembermentGraphNode()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.6f, 0.6f, 0.6f);
NodeCategory = FText::FromString("Default");
NodeDescription = FText::FromString("Base dismemberment graph node");
}
void UDismembermentGraphNode::AllocateDefaultPins()
{
// Base implementation does nothing
// Derived classes will override this
}
FText UDismembermentGraphNode::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
// Default implementation returns the class name
return FText::FromString(GetClass()->GetName());
}
FLinearColor UDismembermentGraphNode::GetNodeTitleColor() const
{
return NodeTitleColor;
}
FText UDismembermentGraphNode::GetTooltipText() const
{
return NodeDescription;
}
FText UDismembermentGraphNode::GetMenuCategory() const
{
return NodeCategory;
}
void UDismembermentGraphNode::CompileNode(class FDismembermentCompiler* Compiler)
{
// Base implementation does nothing
// Derived classes will override this
}
void UDismembermentGraphNode::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Base implementation does nothing
// Derived classes will override this
}

View File

@@ -0,0 +1,35 @@
#include "DismembermentGraph/DismembermentGraphNodeBloodEffect.h"
UDismembermentGraphNodeBloodEffect::UDismembermentGraphNodeBloodEffect()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.8f, 0.0f, 0.0f); // Red for blood
NodeCategory = FText::FromString("Effects");
NodeDescription = FText::FromString("Adds blood effect to the dismemberment");
}
void UDismembermentGraphNodeBloodEffect::AllocateDefaultPins()
{
// Create input pin
CreatePin(EGPD_Input, TEXT("Exec"), TEXT("In"));
// Create output pin
CreatePin(EGPD_Output, TEXT("Exec"), TEXT("Out"));
}
FText UDismembermentGraphNodeBloodEffect::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return FText::FromString("Blood Effect");
}
void UDismembermentGraphNodeBloodEffect::CompileNode(class FDismembermentCompiler* Compiler)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}
void UDismembermentGraphNodeBloodEffect::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -0,0 +1,35 @@
#include "DismembermentGraph/DismembermentGraphNodeBoneSelect.h"
UDismembermentGraphNodeBoneSelect::UDismembermentGraphNodeBoneSelect()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.8f, 0.8f, 0.2f); // Yellow for bone
NodeCategory = FText::FromString("Selection");
NodeDescription = FText::FromString("Selects bones for dismemberment");
}
void UDismembermentGraphNodeBoneSelect::AllocateDefaultPins()
{
// Create input pin
CreatePin(EGPD_Input, TEXT("Exec"), TEXT("In"));
// Create output pin
CreatePin(EGPD_Output, TEXT("Exec"), TEXT("Out"));
}
FText UDismembermentGraphNodeBoneSelect::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return FText::FromString("Bone Selection");
}
void UDismembermentGraphNodeBoneSelect::CompileNode(class FDismembermentCompiler* Compiler)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}
void UDismembermentGraphNodeBoneSelect::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -0,0 +1,35 @@
#include "DismembermentGraph/DismembermentGraphNodeCut.h"
UDismembermentGraphNodeCut::UDismembermentGraphNodeCut()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.2f, 0.6f, 0.8f); // Blue for cut
NodeCategory = FText::FromString("Operations");
NodeDescription = FText::FromString("Performs cutting operation for dismemberment");
}
void UDismembermentGraphNodeCut::AllocateDefaultPins()
{
// Create input pin
CreatePin(EGPD_Input, TEXT("Exec"), TEXT("In"));
// Create output pin
CreatePin(EGPD_Output, TEXT("Exec"), TEXT("Out"));
}
FText UDismembermentGraphNodeCut::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return FText::FromString("Cut Operation");
}
void UDismembermentGraphNodeCut::CompileNode(class FDismembermentCompiler* Compiler)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}
void UDismembermentGraphNodeCut::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -0,0 +1,35 @@
#include "DismembermentGraph/DismembermentGraphNodeOrgan.h"
UDismembermentGraphNodeOrgan::UDismembermentGraphNodeOrgan()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.8f, 0.4f, 0.4f); // Pink for organs
NodeCategory = FText::FromString("Anatomy");
NodeDescription = FText::FromString("Adds organ to the dismemberment system");
}
void UDismembermentGraphNodeOrgan::AllocateDefaultPins()
{
// Create input pin
CreatePin(EGPD_Input, TEXT("Exec"), TEXT("In"));
// Create output pin
CreatePin(EGPD_Output, TEXT("Exec"), TEXT("Out"));
}
FText UDismembermentGraphNodeOrgan::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return FText::FromString("Organ");
}
void UDismembermentGraphNodeOrgan::CompileNode(class FDismembermentCompiler* Compiler)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}
void UDismembermentGraphNodeOrgan::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -0,0 +1,35 @@
#include "DismembermentGraph/DismembermentGraphNodePhysics.h"
UDismembermentGraphNodePhysics::UDismembermentGraphNodePhysics()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.4f, 0.8f, 0.4f); // Green for physics
NodeCategory = FText::FromString("Physics");
NodeDescription = FText::FromString("Configures physics properties for dismembered parts");
}
void UDismembermentGraphNodePhysics::AllocateDefaultPins()
{
// Create input pin
CreatePin(EGPD_Input, TEXT("Exec"), TEXT("In"));
// Create output pin
CreatePin(EGPD_Output, TEXT("Exec"), TEXT("Out"));
}
FText UDismembermentGraphNodePhysics::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return FText::FromString("Physics Properties");
}
void UDismembermentGraphNodePhysics::CompileNode(class FDismembermentCompiler* Compiler)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}
void UDismembermentGraphNodePhysics::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -0,0 +1,35 @@
#include "DismembermentGraph/DismembermentGraphNodeWound.h"
UDismembermentGraphNodeWound::UDismembermentGraphNodeWound()
{
// Initialize default values
NodeTitleColor = FLinearColor(0.8f, 0.2f, 0.2f); // Dark red for wounds
NodeCategory = FText::FromString("Effects");
NodeDescription = FText::FromString("Adds wound effect to the dismemberment");
}
void UDismembermentGraphNodeWound::AllocateDefaultPins()
{
// Create input pin
CreatePin(EGPD_Input, TEXT("Exec"), TEXT("In"));
// Create output pin
CreatePin(EGPD_Output, TEXT("Exec"), TEXT("Out"));
}
FText UDismembermentGraphNodeWound::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return FText::FromString("Wound Effect");
}
void UDismembermentGraphNodeWound::CompileNode(class FDismembermentCompiler* Compiler)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}
void UDismembermentGraphNodeWound::ExecuteNode(class FDismembermentExecutor* Executor)
{
// Implementation will be added in future updates
// This is a placeholder to resolve link errors
}

View File

@@ -214,8 +214,8 @@ void SMatrixInputWidget::UpdateUI()
int32 Index = Row * 4 + Col;
if (NumericEntryBoxes.IsValidIndex(Index) && NumericEntryBoxes[Index].IsValid())
{
// Set value using TOptional<float> instead of SetText or SetValue
NumericEntryBoxes[Index]->SetValue(TOptional<float>(Matrix.M[Row][Col]));
// In UE5.5.4, we need to rebuild the grid panel to update the value
NumericEntryBoxes[Index] = CreateMatrixElementWidget(Row, Col);
}
}
}