------------------------------------------------------------------------------
| 767 | |
| 768 | //------------------------------------------------------------------------------ |
| 769 | bool vtkGLTFDocumentLoaderInternals::LoadMesh( |
| 770 | const nlohmann::json& root, vtkGLTFDocumentLoader::Mesh& mesh) |
| 771 | { |
| 772 | if (root.empty() || !root.is_object()) |
| 773 | { |
| 774 | return false; |
| 775 | } |
| 776 | |
| 777 | if (!vtkGLTFUtils::GetStringValue(root, "name", mesh.Name)) |
| 778 | { |
| 779 | mesh.Name = ""; |
| 780 | } |
| 781 | |
| 782 | // Load primitives |
| 783 | for (const auto& glTFPrimitive : root.value("primitives", nlohmann::json::array())) |
| 784 | { |
| 785 | vtkGLTFDocumentLoader::Primitive primitive; |
| 786 | if (this->LoadPrimitive(glTFPrimitive, primitive)) |
| 787 | { |
| 788 | mesh.Primitives.emplace_back(std::move(primitive)); |
| 789 | } |
| 790 | } |
| 791 | |
| 792 | // Load morph weights |
| 793 | if (!vtkGLTFUtils::GetFloatArray(root, "weights", mesh.Weights)) |
| 794 | { |
| 795 | mesh.Weights.clear(); |
| 796 | } |
| 797 | return true; |
| 798 | } |
| 799 | |
| 800 | //------------------------------------------------------------------------------ |
| 801 | bool vtkGLTFDocumentLoaderInternals::LoadNode( |
no test coverage detected