From 46372a54d3e3964667812186259b2378b96d56b1 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 8d34144c8c..344aea1a58 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -311,6 +311,11 @@ Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj, 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) {