diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-07-29 14:45:06 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-07-29 14:45:06 +0400 |
commit | 4fa17fc69c2680351caf6eda758a6169a143e08d (patch) | |
tree | 11b5bbbbde5899549b0a61534dcfc6e349d64d4b /source/blender/freestyle/intern | |
parent | 725915615a0044962f1f3b3971d942e70bf2eb6f (diff) |
soc-2008-mxcurioni: SWIG replacement is effective and the native Freestyle API renders a correct result for the test style module 'contour.py'. More testing needs to be done to make sure my work was correct.
To make it work, I had to:
- update Operators to include all of its methods in the Python API
- redefine the Freestyle modules as local classes, allowing predicates to support the __call__ method (I found out that Python does not allow modules to be callable). The API is defined in the new freestyle_init.py file.
- remove all references to former Python Freestyle API (located in source/blender/freestyle/python/, under the Freestyle.py file) and replace it with the new API file.
- normalize all constants related to the Nature class
- redefine the logical_operators.py file so that AndUP1D, OrUP1D and NotUP1D would be subclasses of a UnaryPredicate1D subclass having a operator() implementation. Using UnaryPredicate1D as a superclass would somehow prevent calls to the operator(). For the time being, I chose ContourUP1D (even though it does not really matter which subclass it is, since the __call__ method is redefined in all of these classes). I will implement this classes in C++ to get rid of the problem altogether.
- turn off a few classes that somehow are not well recognized (Noise, Curve...). I will reenable them later once I understand what's going on.
Diffstat (limited to 'source/blender/freestyle/intern')
-rwxr-xr-x | source/blender/freestyle/intern/app_blender/AppConfig.cpp | 2 | ||||
-rw-r--r-- | source/blender/freestyle/intern/app_blender/api.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/freestyle/intern/app_blender/AppConfig.cpp b/source/blender/freestyle/intern/app_blender/AppConfig.cpp index 37d139f54e3..0919259bb74 100755 --- a/source/blender/freestyle/intern/app_blender/AppConfig.cpp +++ b/source/blender/freestyle/intern/app_blender/AppConfig.cpp @@ -61,7 +61,7 @@ namespace Config{ string(PATH_SEP.c_str()) + _ProjectDir + string(DIR_SEP.c_str()) + - "style_modules" + + "style_modules_blender" + string(DIR_SEP.c_str()) ; if (getenv("PYTHONPATH")) { _PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH")); diff --git a/source/blender/freestyle/intern/app_blender/api.cpp b/source/blender/freestyle/intern/app_blender/api.cpp index 27b8d578e2f..890c5097a63 100644 --- a/source/blender/freestyle/intern/app_blender/api.cpp +++ b/source/blender/freestyle/intern/app_blender/api.cpp @@ -114,7 +114,7 @@ extern "C" { // add style module string style_module = pathconfig->getProjectDir() + - Config::DIR_SEP + "style_modules" + + Config::DIR_SEP + "style_modules_blender" + Config::DIR_SEP + "contour.py"; controller->InsertStyleModule( 0, const_cast<char *>(style_module.c_str()) ); controller->toggleLayer(0, true); |