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)
This commit is contained in:
2014-07-24 11:08:04 +09:00
parent 4eedec8681
commit b408d8af31
5 changed files with 580 additions and 837 deletions

View File

@@ -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 */
};