From a482f644242456ad6ddf0306e1b37d8855342103 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Wed, 30 Jul 2008 01:51:40 +0000 Subject: =?UTF-8?q?soc-2008-mxcurioni:=20Tested=20SWIG-less=20environment?= =?UTF-8?q?=20more=20and=20understood=20why=20the=20former=20predicate=20m?= =?UTF-8?q?ethods=20were=20not=20working.=20As=20St=C3=A9phane=20had=20men?= =?UTF-8?q?tioned=20a=20few=20months=20ago,=20Freestyle=20uses=20SWIG=20di?= =?UTF-8?q?rectors=20to=20provide=20cross-language=20polymorphism.=20The?= =?UTF-8?q?=20API=20and=20the=20system=20I=20had=20provided=20did=20not=20?= =?UTF-8?q?support=20that=20feature=20and=20only=20implementations=20in=20?= =?UTF-8?q?C++=20were=20supported.=20To=20correct=20the=20problem,=20after?= =?UTF-8?q?=20researching=20how=20directors=20are=20implemented=20in=20SWI?= =?UTF-8?q?G,=20I=20provided=20the=20same=20functionality.=20So=20far,=20I?= =?UTF-8?q?=20only=20provided=20the=20code=20for=20the=20UnaryPredicate1D?= =?UTF-8?q?=20class=20and=20it=20works.=20The=20implementation=20is=20in?= =?UTF-8?q?=20intern/python/Director.cpp=20and=20Operators.cpp.=20I=20will?= =?UTF-8?q?=20port=20the=20remaining=20directors=20tonight=20and=20continu?= =?UTF-8?q?e=20to=20test=20it.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To prevent strokes from piling up after each render, I clear the canvas at each render now (as it should have been all along) --- source/blender/freestyle/intern/python/BPy_Operators.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/freestyle/intern/python/BPy_Operators.cpp') diff --git a/source/blender/freestyle/intern/python/BPy_Operators.cpp b/source/blender/freestyle/intern/python/BPy_Operators.cpp index b0a8e7e3bd2..850b4cb5bad 100644 --- a/source/blender/freestyle/intern/python/BPy_Operators.cpp +++ b/source/blender/freestyle/intern/python/BPy_Operators.cpp @@ -164,7 +164,11 @@ PyObject * Operators_select(BPy_Operators* self, PyObject *args) Py_RETURN_NONE; } - Operators::select(*( ((BPy_UnaryPredicate1D *) obj)->up1D )); + UnaryPredicate1D *up1D = ((BPy_UnaryPredicate1D *) obj)->up1D; + if( PyObject_HasAttrString( obj, "__call__") ) + up1D->setPythonObject( obj ); + + Operators::select(*up1D); Py_RETURN_NONE; } -- cgit v1.2.3