Skip to content

Commit a466340

Browse files
author
Roberto De Ioris
committed
attempt to fix PyFbxFactory
1 parent ca7398e commit a466340

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Source/PythonConsole/Private/PyFbxFactory.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#include "PyFbxFactory.h"
33
#include "FbxMeshUtils.h"
4+
#include "Runtime/Launch/Resources/Version.h"
45

56
UPyFbxFactory::UPyFbxFactory(const FObjectInitializer& ObjectInitializer)
67
: Super(ObjectInitializer)
@@ -23,6 +24,14 @@ void UPyFbxFactory::PostInitProperties() {
2324
ImportUI->MeshTypeToImport = FBXIT_MAX;
2425
}
2526

27+
UObject * UPyFbxFactory::FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled)
28+
{
29+
#if ENGINE_MINOR_VERSION >= 20
30+
FbxMeshUtils::SetImportOption(ImportUI);
31+
#endif
32+
return Super::FactoryCreateFile(InClass, InParent, InName, Flags, Filename, Parms, Warn, bOutOperationCanceled);
33+
}
34+
2635
UObject *UPyFbxFactory::FactoryCreateBinary
2736
(
2837
UClass * InClass,

Source/PythonConsole/Public/PyFbxFactory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class UPyFbxFactory : public UFbxFactory
1515

1616
virtual bool ConfigureProperties() override;
1717
virtual void PostInitProperties() override;
18+
virtual UObject * FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled) override;
1819
virtual UObject * FactoryCreateBinary
1920
(
2021
UClass * InClass,

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ PyObject *py_ue_set_property_flags(ue_PyUObject *self, PyObject * args)
758758
else
759759
{
760760
u_struct = (UStruct *)self->ue_object->GetClass();
761-
}
761+
}
762762

763763
UProperty *u_property = u_struct->FindPropertyByName(FName(UTF8_TO_TCHAR(property_name)));
764764
if (!u_property)
@@ -806,7 +806,7 @@ PyObject *py_ue_add_property_flags(ue_PyUObject *self, PyObject * args)
806806
u_property->SetPropertyFlags(u_property->GetPropertyFlags() | (EPropertyFlags)flags);
807807
#endif
808808
Py_RETURN_NONE;
809-
}
809+
}
810810

811811
PyObject *py_ue_get_property_flags(ue_PyUObject *self, PyObject * args)
812812
{
@@ -1627,7 +1627,7 @@ PyObject *py_ue_add_property(ue_PyUObject * self, PyObject * args)
16271627
if (is_array || is_map)
16281628
scope->MarkPendingKill();
16291629
return PyErr_Format(PyExc_Exception, "unable to allocate new UProperty");
1630-
}
1630+
}
16311631
UMapProperty *u_map = (UMapProperty *)scope;
16321632

16331633
#if ENGINE_MINOR_VERSION < 20
@@ -1676,7 +1676,7 @@ PyObject *py_ue_add_property(ue_PyUObject * self, PyObject * args)
16761676
u_map->ValueProp = u_property2;
16771677

16781678
u_property = u_map;
1679-
}
1679+
}
16801680
#endif
16811681

16821682
if (u_class == UMulticastDelegateProperty::StaticClass())

0 commit comments

Comments
 (0)