More work on properties of components
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user