From fce385dd73acc6d73034c3b856385514bbb3db26 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Thu, 23 Oct 2025 12:04:46 +0200 Subject: [PATCH] Assembly: Fix Iisolate issue when obj and link both in assembly (#24781) * Assembly: Fix Iisolate issue when obj and link both in assembly * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update src/Mod/Assembly/Gui/ViewProviderAssembly.cpp Co-authored-by: Kacper Donat * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kacper Donat --- src/Mod/Assembly/Gui/ViewProviderAssembly.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp b/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp index 8c10b125f9..ce6db14f4d 100644 --- a/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp +++ b/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp @@ -1383,6 +1383,22 @@ void ViewProviderAssembly::applyIsolationRecursively(App::DocumentObject* curren vpg->Selectable.setValue(isolate); if (!isolate) { vpg->ShapeAppearance.setValue(mat); + + // Note, this geometric object could have a link linking to it in the assembly + // and this link may be in isolate set! If so it will inherit the isolation + // from 'current'! So we need to manually handle it to visible. + const std::vector inList = current->getInList(); + for (auto* child : inList) { + if (child->isDerivedFrom() && child->getLinkedObject() == current) { + // In this case we need to reverse isolate this! + auto* childVp = freecad_cast( + Gui::Application::Instance->getViewProvider(child)); + + // we give the child the color the current had before we changed it + childVp->OverrideMaterial.setValue(true); + childVp->ShapeMaterial.setValue(state.shapeMaterial); + } + } } } }