Gui: expose claimChildren to Python
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include <Base/MatrixPy.h>
|
||||
#include <Base/Placement.h>
|
||||
#include <Base/PlacementPy.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
@@ -245,6 +246,22 @@ PyObject* ViewProviderPy::setTransformation(PyObject *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* ViewProviderPy::claimChildren(PyObject* args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
std::vector<App::DocumentObject*> children = this->getViewProviderPtr()->claimChildren();
|
||||
Py::List ret;
|
||||
for(App::DocumentObject* child: children){
|
||||
if (child)
|
||||
ret.append(Py::asObject(child->getPyObject()));
|
||||
else
|
||||
ret.append(Py::None());
|
||||
}
|
||||
return Py::new_reference_to(ret);
|
||||
}
|
||||
|
||||
PyObject *ViewProviderPy::getCustomAttributes(const char* attr) const
|
||||
{
|
||||
// search for dynamic property
|
||||
|
||||
Reference in New Issue
Block a user