--- a/src/linetypes/subfilereference.cpp Sun Oct 24 11:33:32 2021 +0300 +++ b/src/linetypes/subfilereference.cpp Tue Nov 02 15:43:57 2021 +0200 @@ -45,11 +45,11 @@ GetPolygonsContext* context ) const { - Model* model = this->resolve(context->documents); - if (model != nullptr) + Model* referencedModel = this->resolve(context->modelId, context->documents); + if (referencedModel != nullptr) { const bool needInverting = glm::determinant(this->transformation) < 0; - const std::vector<gl::Polygon> modelPolygons = model->getPolygons(context->documents); + const std::vector<gl::Polygon> modelPolygons = referencedModel->getPolygons(context->documents); polygons.reserve(polygons.size() + modelPolygons.size()); for (gl::Polygon polygon : modelPolygons) { @@ -83,9 +83,9 @@ this->isInverted = not this->isInverted; } -Model* ldraw::SubfileReference::resolve(DocumentManager* documents) const +Model* ldraw::SubfileReference::resolve(const ModelId callingModelId, DocumentManager* documents) const { - return documents->findModelByName(this->referenceName); + return documents->findDependencyByName(callingModelId, this->referenceName); } ldraw::Object::Type ldraw::SubfileReference::typeIdentifier() const