Good morning,
I did not find any possible way to do it in Python only, but here is the way I’m doing it using C++
.h
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "CppLib.generated.h"
UCLASS()
class UNREALPYTHONPROJECT_API UCppLib : public UBlueprintFunctionLibrary {
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "Unreal Python")
static TArray<FString> GetAllProperties(UClass* Class);
};
.cpp
#include "CppLib.h"
#include "Runtime/CoreUObject/Public/UObject/UnrealType.h"
TArray<FString> UCppLib::GetAllProperties(UClass* Class) {
TArray<FString> Ret;
if (Class != nullptr) {
for (TFieldIterator<UProperty> It(Class); It; ++It) {
UProperty* Property = *It;
if (Property->HasAnyPropertyFlags(EPropertyFlags::CPF_Edit)) {
Ret.Add(Property->GetName());
}
}
}
return Ret;
}
And then in python:
import unreal
my_python_object = unreal.StaticMesh()
my_object_properties = unreal.CppLib.get_all_properties(my_python_object.get_class())
print my_object_properties