-
Notifications
You must be signed in to change notification settings - Fork 765
Expand file tree
/
Copy pathPyFbxFactory.cpp
More file actions
52 lines (40 loc) · 1.13 KB
/
PyFbxFactory.cpp
File metadata and controls
52 lines (40 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "PyFbxFactory.h"
#include "PythonConsolePrivatePCH.h"
#include "FbxMeshUtils.h"
UPyFbxFactory::UPyFbxFactory(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// disable automatic detection of the factory
ImportPriority = -1;
}
bool UPyFbxFactory::ConfigureProperties() {
bDetectImportTypeOnImport = false;
bShowOption = false;
return true;
}
void UPyFbxFactory::PostInitProperties() {
Super::PostInitProperties();
ImportUI->MeshTypeToImport = FBXIT_MAX;
}
UObject *UPyFbxFactory::FactoryCreateBinary
(
UClass * InClass,
UObject * InParent,
FName InName,
EObjectFlags Flags,
UObject * Context,
const TCHAR * Type,
const uint8 *& Buffer,
const uint8 * BufferEnd,
FFeedbackContext * Warn,
bool & bOutOperationCanceled) {
if (ImportUI->MeshTypeToImport == FBXIT_MAX) {
if (!DetectImportType(UFactory::CurrentFilename)) {
return nullptr;
}
}
FbxMeshUtils::SetImportOption(ImportUI);
// ensure auto-detect is skipped
bDetectImportTypeOnImport = false;
return Super::FactoryCreateBinary(InClass, InParent, InName, Flags, Context, Type, Buffer, BufferEnd, Warn, bOutOperationCanceled);
}