From e8b5cfced75869f814b4e36f2428f8a21e498cc6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 17 Sep 2020 18:25:14 +0200 Subject: [PATCH] MeshGui: [skip ci] expose highlightSegments() to Python --- src/Mod/Mesh/Gui/ViewProviderMeshPy.xml | 7 +++++++ src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshPy.xml b/src/Mod/Mesh/Gui/ViewProviderMeshPy.xml index 1dc409c969..c4af258e95 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshPy.xml +++ b/src/Mod/Mesh/Gui/ViewProviderMeshPy.xml @@ -38,5 +38,12 @@ Clear the selection + + + 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. + + + diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp b/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp index a8215fa589..7c4d546473 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderMeshPyImp.cpp @@ -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 {