From 6c8f9b28a06e6c65e0c56c4ec3e03f32ad264d7a Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Wed, 11 Dec 2024 20:15:03 +0100 Subject: [PATCH] App: Fix GeoFeature::getGlobalPlacement when rootObj is Link This fixes a case when in case of rootObj being Link placement was not calculated correctly due to not changing of the document. While for original use it was fine as this was mostly used in case where there was defined non-link root for general case Links can be root objects of the document. --- src/App/GeoFeature.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp index 2ec1640ee6..057c2e6837 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -297,6 +297,11 @@ Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj, if (targetObj == rootObj) return plc; + if (rootObj->isLink()) { + // Update doc in case its an external link. + doc = rootObj->getLinkedObject()->getDocument(); + } + for (auto& name : names) { App::DocumentObject* obj = doc->getObject(name.c_str()); if (!obj) {