5
5
* SPDX-License-Identifier: Apache-2.0 OR MIT
6
6
*
7
7
*/
8
- #include < AssImpTypeConverter.h>
9
8
#include < AzCore/Debug/Trace.h>
10
9
#include < AzCore/Settings/SettingsRegistry.h>
11
10
#include < AzToolsFramework/Debug/TraceContext.h>
12
11
#include < SceneAPI/SDKWrapper/AssImpNodeWrapper.h>
13
12
#include < SceneAPI/SDKWrapper/AssImpSceneWrapper.h>
13
+ #include < SceneAPI/SDKWrapper/AssImpTypeConverter.h>
14
14
#include < SceneAPI/SceneCore/Utilities/Reporting.h>
15
15
#include < assimp/postprocess.h>
16
16
@@ -39,11 +39,12 @@ namespace AZ
39
39
}
40
40
41
41
#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
42
- void signal_handler ([[maybe_unused]] int signal)
42
+ void signal_handler ([[maybe_unused]] int signal)
43
43
{
44
44
AZ_TracePrintf (
45
45
SceneAPI::Utilities::ErrorWindow,
46
- " Failed to import scene with Asset Importer library. An %s has occurred in the library, this scene file cannot be parsed by the library." ,
46
+ " Failed to import scene with Asset Importer library. An %s has occurred in the library, this scene file cannot be parsed "
47
+ " by the library." ,
47
48
signal == SIGABRT ? " assert" : " unknown error" );
48
49
}
49
50
#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
@@ -59,7 +60,7 @@ namespace AZ
59
60
#ifdef _WRITE_ABORT_MSG
60
61
_set_abort_behavior (0 , _WRITE_ABORT_MSG);
61
62
#endif // #ifdef _WRITE_ABORT_MSG
62
- // Instead, capture any calls to abort with a signal handler, and report them.
63
+ // Instead, capture any calls to abort with a signal handler, and report them.
63
64
auto previous_handler = std::signal (SIGABRT, signal_handler);
64
65
#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL
65
66
@@ -72,12 +73,11 @@ namespace AZ
72
73
// aiProcess_JoinIdenticalVertices is not enabled because O3DE has a mesh optimizer that also does this,
73
74
// this flag is disabled to keep AssImp output similar to FBX SDK to reduce downstream bugs for the initial AssImp release.
74
75
// There's currently a minimum of properties and flags set to maximize compatibility with the existing node graph.
75
- unsigned int importFlags =
76
- aiProcess_Triangulate // Triangulates all faces of all meshes
77
- | static_cast <unsigned long >(aiProcess_GenBoundingBoxes) // Generate bounding boxes
78
- | aiProcess_GenNormals // Generate normals for meshes
79
- | (importSettings.m_optimizeScene ? aiProcess_OptimizeGraph : 0 ) // Merge excess scene nodes together
80
- | (importSettings.m_optimizeMeshes ? aiProcess_OptimizeMeshes : 0 ) // Combines meshes in the scene together
76
+ unsigned int importFlags = aiProcess_Triangulate // Triangulates all faces of all meshes
77
+ | static_cast <unsigned long >(aiProcess_GenBoundingBoxes) // Generate bounding boxes
78
+ | aiProcess_GenNormals // Generate normals for meshes
79
+ | (importSettings.m_optimizeScene ? aiProcess_OptimizeGraph : 0 ) // Merge excess scene nodes together
80
+ | (importSettings.m_optimizeMeshes ? aiProcess_OptimizeMeshes : 0 ) // Combines meshes in the scene together
81
81
;
82
82
83
83
// aiProcess_LimitBoneWeights is not enabled because it will remove bones which are not associated with a mesh.
@@ -101,7 +101,10 @@ namespace AZ
101
101
102
102
if (!m_assImpScene)
103
103
{
104
- AZ_TracePrintf (SceneAPI::Utilities::ErrorWindow, " Failed to import Asset Importer Scene. Error returned: %s" , m_importer->GetErrorString ());
104
+ AZ_TracePrintf (
105
+ SceneAPI::Utilities::ErrorWindow,
106
+ " Failed to import Asset Importer Scene. Error returned: %s" ,
107
+ m_importer->GetErrorString ());
105
108
return false ;
106
109
}
107
110
0 commit comments