MeshGui: [skip ci] expose highlightSegments() to Python

This commit is contained in:
wmayer
2020-09-17 18:25:14 +02:00
parent b9e5bce0f0
commit e8b5cfced7
2 changed files with 19 additions and 0 deletions

View File

@@ -38,5 +38,12 @@
<UserDocu>Clear the selection</UserDocu>
</Documentation>
</Methode>
<Methode Name="highlightSegments">
<Documentation>
<UserDocu>Highlights the segments of a mesh with a given list of colors.
The number of elements of this list must be equal to the number of mesh segments.
</UserDocu>
</Documentation>
</Methode>
</PythonExport>
</GenerateModel>

View File

@@ -124,7 +124,19 @@ PyObject* ViewProviderMeshPy::clearSelection(PyObject *args)
Py_Return;
}
PyObject* ViewProviderMeshPy::highlightSegments(PyObject *args)
{
PyObject* list;
if (!PyArg_ParseTuple(args, "O", &list))
return 0;
App::PropertyColorList colors;
colors.setPyObject(list);
ViewProviderMesh* vp = getViewProviderMeshPtr();
vp->highlightSegments(colors.getValues());
Py_Return;
}
PyObject *ViewProviderMeshPy::getCustomAttributes(const char* /*attr*/) const
{