MCPcopy Create free account
hub / github.com/assimp/assimp / ImportNodes

Method ImportNodes

code/AssetLib/glTF/glTFImporter.cpp:607–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607void glTFImporter::ImportNodes(Asset &r) {
608 if (!r.scene) {
609 return;
610 }
611
612 std::vector<Ref<Node>> rootNodes = r.scene->nodes;
613
614 // The root nodes
615 if (auto numRootNodes = static_cast<unsigned>(rootNodes.size()); numRootNodes == 1) { // a single root node: use it
616 mScene->mRootNode = ImportNode(mScene, r, meshOffsets, rootNodes[0]);
617 } else if (numRootNodes > 1) { // more than one root node: create a fake root
618 aiNode *root = new aiNode("ROOT");
619 root->mChildren = new aiNode *[numRootNodes];
620 for (unsigned int i = 0; i < numRootNodes; ++i) {
621 aiNode *node = ImportNode(mScene, r, meshOffsets, rootNodes[i]);
622 node->mParent = root;
623 root->mChildren[root->mNumChildren++] = node;
624 }
625 mScene->mRootNode = root;
626 }
627}
628
629void glTFImporter::ImportEmbeddedTextures(Asset &r) {
630 embeddedTexIdxs.resize(r.images.Size(), -1);

Callers

nothing calls this directly

Calls 2

ImportNodeFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected