MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / ReadFile

Method ReadFile

Engine/lib/assimp/code/Common/BaseImporter.cpp:90–126  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Imports the given file and returns the imported data.

Source from the content-addressed store, hash-verified

88// ------------------------------------------------------------------------------------------------
89// Imports the given file and returns the imported data.
90aiScene *BaseImporter::ReadFile(Importer *pImp, const std::string &pFile, IOSystem *pIOHandler) {
91
92 m_progress = pImp->GetProgressHandler();
93 if (nullptr == m_progress) {
94 return nullptr;
95 }
96
97 ai_assert(m_progress);
98
99 // Gather configuration properties for this run
100 SetupProperties(pImp);
101
102 // Construct a file system filter to improve our success ratio at reading external files
103 FileSystemFilter filter(pFile, pIOHandler);
104
105 // create a scene object to hold the data
106 std::unique_ptr<aiScene> sc(new aiScene());
107
108 // dispatch importing
109 try {
110 InternReadFile(pFile, sc.get(), &filter);
111
112 // Calculate import scale hook - required because pImp not available anywhere else
113 // passes scale into ScaleProcess
114 UpdateImporterScale(pImp);
115
116 } catch( const std::exception &err ) {
117 // extract error description
118 m_ErrorText = err.what();
119 ASSIMP_LOG_ERROR(err.what());
120 m_Exception = std::current_exception();
121 return nullptr;
122 }
123
124 // return what we gathered from the import.
125 return sc.release();
126}
127
128// ------------------------------------------------------------------------------------------------
129void BaseImporter::SetupProperties(const Importer *) {

Callers 1

LoadAllMethod · 0.45

Calls 4

GetProgressHandlerMethod · 0.80
getMethod · 0.45
whatMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected