From 6082b67ed0d325c08032379c28fc4ef9696cd1b1 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Tue, 25 Jun 2024 11:35:41 +0200 Subject: [PATCH] Assembly: Insert Component: Fix 'Joint Group' being listed even though it's empty. It's because we were using OutList instead of claimChildren. --- src/Gui/ViewProviderPyImp.cpp | 4 ++-- src/Mod/Assembly/CommandInsertLink.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Gui/ViewProviderPyImp.cpp b/src/Gui/ViewProviderPyImp.cpp index 76784ccf6e..066ae1bd19 100644 --- a/src/Gui/ViewProviderPyImp.cpp +++ b/src/Gui/ViewProviderPyImp.cpp @@ -393,7 +393,7 @@ PyObject* ViewProviderPy::claimChildren(PyObject* args) std::vector children = this->getViewProviderPtr()->claimChildren(); Py::List ret; - for(auto* child: children){ + for(auto* child : children){ if (child) ret.append(Py::asObject(child->getPyObject())); else @@ -409,7 +409,7 @@ PyObject* ViewProviderPy::claimChildrenRecursive(PyObject* args) std::vector children = this->getViewProviderPtr()->claimChildrenRecursive(); Py::List ret; - for(auto* child: children){ + for(auto* child : children){ if (child) ret.append(Py::asObject(child->getPyObject())); else diff --git a/src/Mod/Assembly/CommandInsertLink.py b/src/Mod/Assembly/CommandInsertLink.py index d9b2cfcd79..75c403d569 100644 --- a/src/Mod/Assembly/CommandInsertLink.py +++ b/src/Mod/Assembly/CommandInsertLink.py @@ -180,7 +180,7 @@ class TaskAssemblyInsertLink(QtCore.QObject): (not onlyParts and child.isDerivedFrom("Part::Feature")) or child.isDerivedFrom("App::Part") ) - for child in obj.OutListRecursive + for child in obj.ViewObject.claimChildrenRecursive() ): continue # Skip this object if no relevant children @@ -201,7 +201,7 @@ class TaskAssemblyInsertLink(QtCore.QObject): if obj.isDerivedFrom("App::Part") or obj.isDerivedFrom( "App::DocumentObjectGroup" ): - process_objects(obj.OutList, objItem) + process_objects(obj.ViewObject.claimChildren(), objItem) guiDoc = Gui.getDocument(doc.Name) process_objects(guiDoc.TreeRootObjects, docItem)