diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-20 11:57:26 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-20 11:57:26 +0400 |
commit | a462d69bbf771e49d2fa49589608c375376b42ed (patch) | |
tree | 60d85d4131399a0a39dbc582e30a7144b14edc18 /source/blender/python | |
parent | d433cd65f7127d60e17d05a824290423ad226eae (diff) |
Another big patch set by Bastien Montagne, thanks a lot!
* Made Freestyle optional (turned on by default).
* Fix for missing bpath.c updates in the previous merge of trunk changes.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/SConscript | 5 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/CMakeLists.txt | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_build_options.c | 4 |
5 files changed, 28 insertions, 3 deletions
diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 21af50dbf10..ddb8594de79 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -31,7 +31,6 @@ Import ('env') incs = '. ../editors/include ../makesdna ../makesrna ../blenfont ../blenlib ../blenkernel ../nodes' incs += ' ../imbuf ../blenloader ../bmesh ../gpu ../render/extern/include ../windowmanager' -incs += ' ../freestyle/intern/python' incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include #intern/cycles/blender' incs += ' #intern/audaspace/intern ' + env['BF_PYTHON_INC'] @@ -102,6 +101,10 @@ if env['WITH_BF_CYCLES']: if env['WITH_BF_CYCLES_OSL']: defs.append('WITH_CYCLES_OSL') +if env['WITH_BF_FREESTYLE']: + incs += ' ../freestyle/intern/python' + defs.append('WITH_FREESTYLE') + if env['WITH_BF_GAMEENGINE']: defs.append('WITH_GAMEENGINE') diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index d0af6371059..f39e170c481 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -82,7 +82,9 @@ PyC_FlagSet bpy_bm_hflag_all_flags[] = { {BM_ELEM_SEAM, "SEAM"}, {BM_ELEM_SMOOTH, "SMOOTH"}, {BM_ELEM_TAG, "TAG"}, +#ifdef WITH_FREESTYLE {BM_ELEM_FREESTYLE, "FREESTYLE"}, +#endif {0, NULL} }; @@ -102,8 +104,10 @@ PyDoc_STRVAR(bpy_bm_elem_tag_doc, "Generic attribute scripts can use for own PyDoc_STRVAR(bpy_bm_elem_smooth_doc, "Smooth state of this element.\n\n:type: boolean"); PyDoc_STRVAR(bpy_bm_elem_seam_doc, "Seam for UV unwrapping.\n\n:type: boolean"); +#ifdef WITH_FREESTYLE PyDoc_STRVAR(bpy_bm_freestyle_edge_mark_doc, "Freestyle edge mark.\n\n:type: boolean"); PyDoc_STRVAR(bpy_bm_freestyle_face_mark_doc, "Freestyle face mark.\n\n:type: boolean"); +#endif static PyObject *bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag) { @@ -665,7 +669,9 @@ static PyGetSetDef bpy_bmedge_getseters[] = { {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH}, {(char *)"seam", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_seam_doc, (void *)BM_ELEM_SEAM}, +#ifdef WITH_FREESTYLE {(char *)"freestyle_edge_mark", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_freestyle_edge_mark_doc, (void *)BM_ELEM_FREESTYLE}, +#endif /* connectivity data */ {(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_verts_doc, (void *)BM_VERTS_OF_EDGE}, @@ -691,7 +697,9 @@ static PyGetSetDef bpy_bmface_getseters[] = { {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH}, +#ifdef WITH_FREESTYLE {(char *)"freestyle_face_mark", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_freestyle_face_mark_doc, (void *)BM_ELEM_FREESTYLE}, +#endif {(char *)"normal", (getter)bpy_bmface_normal_get, (setter)bpy_bmface_normal_set, (char *)bpy_bmface_normal_doc, NULL}, diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index b2ce33b08c7..8f90a823668 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -35,7 +35,6 @@ set(INC ../../makesrna ../../windowmanager ../../../../intern/cycles/blender - ../../freestyle/intern/python ../../../../intern/guardedalloc ) @@ -140,6 +139,13 @@ if(WITH_CYCLES_OSL) add_definitions(-DWITH_CYCLES_OSL) endif() +if(WITH_FREESTYLE) + list(APPEND INC + ../../freestyle/intern/python + ) + add_definitions(-DWITH_FREESTYLE) +endif() + if(WITH_GAMEENGINE) add_definitions(-DWITH_GAMEENGINE) endif() diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index b0dd8a29fbe..4f932ac68ff 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -60,7 +60,9 @@ #include "../generic/blf_py_api.h" #include "../mathutils/mathutils.h" -#include "BPy_Freestyle.h" +#ifdef WITH_FREESTYLE +# include "BPy_Freestyle.h" +#endif PyObject *bpy_package_py = NULL; @@ -259,7 +261,9 @@ void BPy_init_modules(void) } /* stand alone utility modules not related to blender directly */ IDProp_Init_Types(); /* not actually a submodule, just types */ +#ifdef WITH_FREESTYLE Freestyle_Init(); +#endif mod = PyModule_New("_bpy"); diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c index 607613b592c..74df3ef7307 100644 --- a/source/blender/python/intern/bpy_app_build_options.c +++ b/source/blender/python/intern/bpy_app_build_options.c @@ -72,6 +72,10 @@ static PyObject *make_build_options(void) SetStrItem("CYCLES_OSL"); #endif +#ifdef WITH_FREESTYLE + SetStrItem("FREESTYLE"); +#endif + #ifdef WITH_GAMEENGINE SetStrItem("GAMEENGINE"); #endif |