Core: ViewProvider: Add claimChildrenRecursive
This commit is contained in:
@@ -393,7 +393,23 @@ PyObject* ViewProviderPy::claimChildren(PyObject* args)
|
||||
|
||||
std::vector<App::DocumentObject*> children = this->getViewProviderPtr()->claimChildren();
|
||||
Py::List ret;
|
||||
for(App::DocumentObject* child: children){
|
||||
for(auto* child: children){
|
||||
if (child)
|
||||
ret.append(Py::asObject(child->getPyObject()));
|
||||
else
|
||||
ret.append(Py::None());
|
||||
}
|
||||
return Py::new_reference_to(ret);
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::claimChildrenRecursive(PyObject* args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return nullptr;
|
||||
|
||||
std::vector<App::DocumentObject*> children = this->getViewProviderPtr()->claimChildrenRecursive();
|
||||
Py::List ret;
|
||||
for(auto* child: children){
|
||||
if (child)
|
||||
ret.append(Py::asObject(child->getPyObject()));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user