More work on properties of components

This commit is contained in:
2026-03-19 16:26:00 -04:00
parent 56f2257dd9
commit 2eb2be7af1
5 changed files with 39 additions and 12 deletions

View File

@@ -115,7 +115,20 @@ WingFetcher& WingFetcher::Asset(const FString& PackagePath)
{
if (bError) return *this;
SetObj(LoadObject<UObject>(nullptr, *PackagePath));
// Try to find the object in memory first (silent), then load if needed.
// LoadObject logs its own errors when the package doesn't exist, so
// we check DoesPackageExist first to avoid redundant log spam.
SetObj(FindObject<UObject>(nullptr, *PackagePath));
if (!Obj)
{
FString PackageName = FPackageName::ObjectPathToPackageName(PackagePath);
if (!FPackageName::DoesPackageExist(PackageName))
{
UWingServer::Printf(TEXT("ERROR: Asset '%s' does not exist.\n"), *PackagePath);
return SetError();
}
SetObj(LoadObject<UObject>(nullptr, *PackagePath));
}
if (!Obj)
{
UWingServer::Printf(TEXT("ERROR: Could not load asset '%s'\n"), *PackagePath);

View File

@@ -3,6 +3,7 @@
#include "WingServer.h"
#include "WingTypes.h"
#include "Engine/Blueprint.h"
#include "Engine/SCS_Node.h"
#include "MaterialGraph/MaterialGraphNode.h"
#include "EdGraph/EdGraphPin.h"
#include "UObject/EnumProperty.h"
@@ -138,6 +139,19 @@ TArray<FWingProperty> FWingProperty::GetAll(UObject* Obj, EPropertyFlags Flags)
Obj = BP->GeneratedClass->GetDefaultObject();
}
// SCS nodes don't have useful editable properties.
// Redirect to the component template instead.
//
if (USCS_Node* Node = ::Cast<USCS_Node>(Obj))
{
if (!Node->ComponentTemplate)
{
UWingServer::Printf(TEXT("ERROR: SCS node '%s' has no component template\n"), *Obj->GetName());
return {};
}
Obj = Node->ComponentTemplate;
}
TArray<FWingProperty> Result;
Collect(Obj->GetClass(), Obj, Result, Flags);