------------------------------------------------------------------------------------------------
| 193 | |
| 194 | // ------------------------------------------------------------------------------------------------ |
| 195 | void BlenderImporter::ExtractScene(Scene &out, const FileDatabase &file) { |
| 196 | const FileBlockHead *block = nullptr; |
| 197 | std::map<std::string, size_t>::const_iterator it = file.dna.indices.find("Scene"); |
| 198 | if (it == file.dna.indices.end()) { |
| 199 | ThrowException("There is no `Scene` structure record"); |
| 200 | } |
| 201 | |
| 202 | const Structure &ss = file.dna.structures[(*it).second]; |
| 203 | |
| 204 | // we need a scene somewhere to start with. |
| 205 | for (const FileBlockHead &bl : file.entries) { |
| 206 | |
| 207 | // Fix: using the DNA index is more reliable to locate scenes |
| 208 | //if (bl.id == "SC") { |
| 209 | |
| 210 | if (bl.dna_index == (*it).second) { |
| 211 | block = &bl; |
| 212 | break; |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | if (!block) { |
| 217 | ThrowException("There is not a single `Scene` record to load"); |
| 218 | } |
| 219 | |
| 220 | file.reader->SetCurrentPos(block->start); |
| 221 | ss.Convert(out, file); |
| 222 | |
| 223 | #ifndef ASSIMP_BUILD_BLENDER_NO_STATS |
| 224 | ASSIMP_LOG_INFO( |
| 225 | "(Stats) Fields read: ", file.stats().fields_read, |
| 226 | ", pointers resolved: ", file.stats().pointers_resolved, |
| 227 | ", cache hits: ", file.stats().cache_hits, |
| 228 | ", cached objects: ", file.stats().cached_objects); |
| 229 | #endif |
| 230 | } |
| 231 | |
| 232 | // ------------------------------------------------------------------------------------------------ |
| 233 | void BlenderImporter::ParseSubCollection(const Blender::Scene &in, aiNode *root, const std::shared_ptr<Collection>& collection, ConversionData &conv_data) { |
nothing calls this directly
no test coverage detected