From d2ff5eaebefd42efe9943e17b267a0d7f4e3c73f Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 12 Jul 2020 16:03:01 +0200 Subject: [PATCH] Part: fix regression of visibility automation in Attachment dialog If a body is in a Part container and a new primitive is created no preview is shown because the Part container is automatically made invisiible. The user has to manually make the container visible but this is an error-prone procedure because the Attachment dialog reacts on user-selection and thus unintended things can happen. So, this is a serious regression of usability. The regression is caused by commit cd73df745124 but the commit log doesn't explain why the change was even needed. So, this commit leaves the previous changes but re-adds the old check to filter out container objects. --- src/Mod/Part/Gui/TaskAttacher.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Part/Gui/TaskAttacher.cpp b/src/Mod/Part/Gui/TaskAttacher.cpp index 7dc2b33d44..bac4819481 100644 --- a/src/Mod/Part/Gui/TaskAttacher.cpp +++ b/src/Mod/Part/Gui/TaskAttacher.cpp @@ -944,9 +944,11 @@ void TaskAttacher::visibilityAutomation(bool opening_not_closing) if (opening_not_closing) { QString code = QString::fromLatin1( "import Show\n" + "from Show.Containers import isAContainer\n" "_tv_%4 = Show.TempoVis(App.ActiveDocument, tag= 'PartGui::TaskAttacher')\n" "tvObj = %1\n" "dep_features = _tv_%4.get_all_dependent(%2, '%3')\n" + "dep_features = [o for o in dep_features if not isAContainer(o)]\n" "if tvObj.isDerivedFrom('PartDesign::CoordinateSystem'):\n" "\tvisible_features = [feat for feat in tvObj.InList if feat.isDerivedFrom('PartDesign::FeaturePrimitive')]\n" "\tdep_features = [feat for feat in dep_features if feat not in visible_features]\n"