[Bf-blender-cvs] [51bdbcfc874] temp-gpencil-io: GPencil: Add python flags for new Haru and Pugixml libraries
Antonio Vazquez
noreply at git.blender.org
Wed Feb 10 15:12:35 CET 2021
Commit: 51bdbcfc874c345c712eb94584d41de3faf9ef2d
Author: Antonio Vazquez
Date: Wed Feb 10 15:12:23 2021 +0100
Branches: temp-gpencil-io
https://developer.blender.org/rB51bdbcfc874c345c712eb94584d41de3faf9ef2d
GPencil: Add python flags for new Haru and Pugixml libraries
===================================================================
M release/scripts/startup/bl_ui/space_topbar.py
M source/blender/python/intern/CMakeLists.txt
M source/blender/python/intern/bpy_app_build_options.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index be1d3b1a052..b5515339035 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -460,8 +460,12 @@ class TOPBAR_MT_file_gpencil_export(Menu):
bl_owner_use_filter = False
def draw(self, context):
- self.layout.operator("wm.gpencil_export_svg", text="Scalable Vector Graphics (.svg)")
- self.layout.operator("wm.gpencil_export_pdf", text="Portable Document Format (.pdf)")
+ # Pugixml lib dependency
+ if bpy.app.build_options.pugixml:
+ self.layout.operator("wm.gpencil_export_svg", text="Scalable Vector Graphics (.svg)")
+ # Haru lib dependency
+ if bpy.app.build_options.haru:
+ self.layout.operator("wm.gpencil_export_pdf", text="Portable Document Format (.pdf)")
class TOPBAR_MT_file_export(Menu):
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 5d8330e368d..80f1f64a89b 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -349,4 +349,12 @@ if(WITH_POTRACE)
add_definitions(-DWITH_POTRACE)
endif()
+if(WITH_PUGIXML)
+ add_definitions(-DWITH_PUGIXML)
+endif()
+
+if(WITH_HARU)
+ add_definitions(-DWITH_HARU)
+endif()
+
blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c
index aaceb7b393f..ea77004746d 100644
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@ -62,6 +62,8 @@ static PyStructSequence_Field app_builtopts_info_fields[] = {
{"fluid", NULL},
{"xr_openxr", NULL},
{"potrace", NULL},
+ {"pugixml", NULL},
+ {"haru", NULL},
{NULL},
};
@@ -289,6 +291,18 @@ static PyObject *make_builtopts_info(void)
SetObjIncref(Py_False);
#endif
+#ifdef WITH_PUGIXML
+ SetObjIncref(Py_True);
+#else
+ SetObjIncref(Py_False);
+#endif
+
+#ifdef WITH_HARU
+ SetObjIncref(Py_True);
+#else
+ SetObjIncref(Py_False);
+#endif
+
#undef SetObjIncref
return builtopts_info;
More information about the Bf-blender-cvs
mailing list