From b408d8af31c9fba5898e353c97f95f7ce8dc19c1 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Thu, 24 Jul 2014 11:08:04 +0900 Subject: Freestyle Python API: Updates and speedups for the parameter editor In addition to D319, this patch updates the parameter editor, the UI of Freestyle. Using new API functionality and experience gained in making D319, this patch provides a quite noticable speedup for commonly-used Freestyle linestyle modifiers. As this patch touches a lot of code (and mainly the foundations) it is likely that mistakes are made. The patch has been tested with a regression suite for Freestyle (https://github.com/folkertdev/freestyle-regression-tests/tree/master), but testing with scenes used in production is very much appreciated. Differential revision: https://developer.blender.org/D623 Author: flokkievids (Folkert de Vries) Reviewed by: kjym3 (Tamito Kajiyama) --- .../intern/python/Interface0D/BPy_CurvePoint.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/freestyle/intern') diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp index 36cdb1b92ff..7239b1b4a7b 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp @@ -178,6 +178,19 @@ static int CurvePoint_second_svertex_set(BPy_CurvePoint *self, PyObject *value, return 0; } +PyDoc_STRVAR(CurvePoint_fedge_doc, +"Gets the FEdge for the two SVertices that given CurvePoints consists out of.\n" +"A shortcut for CurvePoint.first_svertex.get_fedge(CurvePoint.second_svertex).\n" +"\n" +":type: :class:`FEdge`"); + +static PyObject *CurvePoint_fedge_get(BPy_CurvePoint *self, void *UNUSED(closure)) +{ + SVertex *A = self->cp->A(); + Interface0D *B = (Interface0D *)self->cp->B(); + return Any_BPy_Interface1D_from_Interface1D(*(A->getFEdge(*B))); +} + PyDoc_STRVAR(CurvePoint_t2d_doc, "The 2D interpolation parameter.\n" "\n" @@ -204,6 +217,8 @@ static PyGetSetDef BPy_CurvePoint_getseters[] = { (char *)CurvePoint_first_svertex_doc, NULL}, {(char *)"second_svertex", (getter)CurvePoint_second_svertex_get, (setter)CurvePoint_second_svertex_set, (char *)CurvePoint_second_svertex_doc, NULL}, + {(char *)"fedge", (getter)CurvePoint_fedge_get, NULL, + CurvePoint_fedge_doc, NULL}, {(char *)"t2d", (getter)CurvePoint_t2d_get, (setter)CurvePoint_t2d_set, (char *)CurvePoint_t2d_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; -- cgit v1.2.3