Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-07-24 06:08:04 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-07-24 09:29:35 +0400
commitb408d8af31c9fba5898e353c97f95f7ce8dc19c1 (patch)
tree45310106f7f6e59c9f6310e1a58ab5b1d1cadb46 /source/blender/freestyle
parent4eedec86819ff91f1c96405603650e2833c77b9a (diff)
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)
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp15
1 files changed, 15 insertions, 0 deletions
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 */
};