------------------------------------------------------------------------------
| 1236 | |
| 1237 | //------------------------------------------------------------------------------ |
| 1238 | bool vtkGLTFDocumentLoaderInternals::LoadTexture( |
| 1239 | const nlohmann::json& root, vtkGLTFDocumentLoader::Texture& texture) |
| 1240 | { |
| 1241 | /** |
| 1242 | * This loads a glTF object from a Json value, no files are loaded by this function. |
| 1243 | * Apart from the 'name' field, glTF texture objects contain two integer indices: one to an |
| 1244 | * image object (the object that references to an actual image file), and one to a sampler |
| 1245 | * object (which specifies filter and wrapping options for a texture). |
| 1246 | */ |
| 1247 | if (root.empty() || !root.is_object()) |
| 1248 | { |
| 1249 | vtkErrorWithObjectMacro(this->Self, "Invalid texture object."); |
| 1250 | return false; |
| 1251 | } |
| 1252 | texture.Sampler = -1; |
| 1253 | vtkGLTFUtils::GetIntValue(root, "sampler", texture.Sampler); |
| 1254 | texture.Source = -1; |
| 1255 | vtkGLTFUtils::GetIntValue(root, "source", texture.Source); |
| 1256 | texture.Name = ""; |
| 1257 | vtkGLTFUtils::GetStringValue(root, "name", texture.Name); |
| 1258 | |
| 1259 | return true; |
| 1260 | } |
| 1261 | |
| 1262 | //------------------------------------------------------------------------------ |
| 1263 | bool vtkGLTFDocumentLoaderInternals::LoadTextureInfo( |
no test coverage detected