diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp index 41c2a2e194..68606dbc7d 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.cpp +++ b/libraries/model-networking/src/model-networking/ModelCache.cpp @@ -232,7 +232,7 @@ std::shared_ptr ModelCache::getGeometry(const QUrl& url, const GeometryExtra geometryExtra = { mapping, textureBaseUrl }; GeometryResource::Pointer resource = getResource(url, QUrl(), true, &geometryExtra).staticCast(); if (resource) { - if (resource->isLoaded() && !resource->hasTextures()) { + if (resource->isLoaded() && resource->shouldSetTextures()) { resource->setTextures(); } return std::make_shared(resource); diff --git a/libraries/model-networking/src/model-networking/ModelCache.h b/libraries/model-networking/src/model-networking/ModelCache.h index 81883d972d..f479dc9ce2 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.h +++ b/libraries/model-networking/src/model-networking/ModelCache.h @@ -107,7 +107,8 @@ protected: friend class GeometryMappingResource; // Geometries may not hold onto textures while cached - that is for the texture cache - bool hasTextures() const { return !_materials.empty(); } + // Instead, these methods clear and reset textures from the geometry when caching/loading + bool shouldSetTextures() const { return _geometry && _materials.empty(); } void setTextures(); void resetTextures();