diff options
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/SConscript | 4 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 25 | ||||
-rw-r--r-- | source/blender/python/intern/CMakeLists.txt | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 13 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_build_options.c | 7 |
6 files changed, 52 insertions, 11 deletions
diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index c28987eb156..4fb6d771c5b 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -98,6 +98,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 ed7b48fb14f..cde977288d1 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -77,11 +77,14 @@ PyC_FlagSet bpy_bm_htype_all_flags[] = { }; PyC_FlagSet bpy_bm_hflag_all_flags[] = { - {BM_ELEM_SELECT, "SELECT"}, - {BM_ELEM_HIDDEN, "HIDE"}, - {BM_ELEM_SEAM, "SEAM"}, - {BM_ELEM_SMOOTH, "SMOOTH"}, - {BM_ELEM_TAG, "TAG"}, + {BM_ELEM_SELECT, "SELECT"}, + {BM_ELEM_HIDDEN, "HIDE"}, + {BM_ELEM_SEAM, "SEAM"}, + {BM_ELEM_SMOOTH, "SMOOTH"}, + {BM_ELEM_TAG, "TAG"}, +#ifdef WITH_FREESTYLE + {BM_ELEM_FREESTYLE, "FREESTYLE"}, +#endif {0, NULL} }; @@ -101,6 +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) { @@ -662,6 +669,10 @@ 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}, @@ -686,6 +697,10 @@ 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}, {(char *)"material_index", (getter)bpy_bmface_material_index_get, (setter)bpy_bmface_material_index_set, (char *)bpy_bmface_material_index_doc, NULL}, diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index b531e08f8d4..30ab4bd4b0e 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -143,6 +143,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 c4d68290da3..1f8385288bd 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -60,6 +60,10 @@ #include "../generic/blf_py_api.h" #include "../mathutils/mathutils.h" +#ifdef WITH_FREESTYLE +# include "BPy_Freestyle.h" +#endif + PyObject *bpy_package_py = NULL; PyDoc_STRVAR(bpy_script_paths_doc, @@ -258,6 +262,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.c b/source/blender/python/intern/bpy_app.c index 5195f821d56..7889b9a7f0b 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -245,12 +245,13 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl static PyGetSetDef bpy_app_getsets[] = { - {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG}, - {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG}, - {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON}, - {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS}, - {(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS}, - {(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM}, + {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG}, + {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG}, + {(char *)"debug_freestyle", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FREESTYLE}, + {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON}, + {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS}, + {(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS}, + {(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM}, {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL}, {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL}, diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c index 6db0a52bdf0..60105f73f37 100644 --- a/source/blender/python/intern/bpy_app_build_options.c +++ b/source/blender/python/intern/bpy_app_build_options.c @@ -41,6 +41,7 @@ static PyStructSequence_Field app_builtopts_info_fields[] = { {(char *)"compositor", NULL}, {(char *)"cycles", NULL}, {(char *)"cycles_osl", NULL}, + {(char *)"freestyle", NULL}, {(char *)"gameengine", NULL}, {(char *)"image_cineon", NULL}, {(char *)"image_dds", NULL}, @@ -137,6 +138,12 @@ static PyObject *make_builtopts_info(void) SetObjIncref(Py_False); #endif +#ifdef WITH_FREESTYLE + SetObjIncref(Py_True); +#else + SetObjIncref(Py_False); +#endif + #ifdef WITH_GAMEENGINE SetObjIncref(Py_True); #else |