Assembly: Insert Component: Fix 'Joint Group' being listed even though it's empty. It's because we were using OutList instead of claimChildren.

This commit is contained in:
PaddleStroke
2024-06-25 11:35:41 +02:00
parent 8ef57be4bb
commit 6082b67ed0
2 changed files with 4 additions and 4 deletions

View File

@@ -393,7 +393,7 @@ PyObject* ViewProviderPy::claimChildren(PyObject* args)
std::vector<App::DocumentObject*> 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<App::DocumentObject*> children = this->getViewProviderPtr()->claimChildrenRecursive();
Py::List ret;
for(auto* child: children){
for(auto* child : children){
if (child)
ret.append(Py::asObject(child->getPyObject()));
else

View File

@@ -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)