From a8a92cd15a5251377474fbfdcf9ff0298a8457a9 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 24 Mar 2021 15:14:43 +0100 Subject: GPencil: New modules for Import and Export This patch adds support to export and import grease pencil in several formats. Inlude: * Export SVG * Export PDF (always from camera view) * Import SVG The import and export only support solid colors and not gradients or textures. Requires libharu and pugixml. For importing SVG, the NanoSVG lib is used, but this does not require installation (just a .h file embedded in the project folder) Example of PDF export: https://youtu.be/BMm0KeMJsI4 Reviewed By: #grease_pencil, HooglyBoogly Maniphest Tasks: T83190, T79875, T83191, T83192 Differential Revision: https://developer.blender.org/D10482 --- release/scripts/startup/bl_ui/space_topbar.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 7219922c379..adab0b0c88a 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -469,6 +469,8 @@ class TOPBAR_MT_file_import(Menu): if bpy.app.build_options.alembic: self.layout.operator("wm.alembic_import", text="Alembic (.abc)") + self.layout.operator("wm.gpencil_import_svg", text="SVG as Grease Pencil") + class TOPBAR_MT_file_export(Menu): bl_idname = "TOPBAR_MT_file_export" @@ -485,6 +487,13 @@ class TOPBAR_MT_file_export(Menu): self.layout.operator( "wm.usd_export", text="Universal Scene Description (.usd, .usdc, .usda)") + # Pugixml lib dependency + if bpy.app.build_options.pugixml: + self.layout.operator("wm.gpencil_export_svg", text="Grease Pencil as SVG") + # Haru lib dependency + if bpy.app.build_options.haru: + self.layout.operator("wm.gpencil_export_pdf", text="Grease Pencil as PDF") + class TOPBAR_MT_file_external_data(Menu): bl_label = "External Data" -- cgit v1.2.3