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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user