diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-03-24 17:14:43 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-03-24 17:28:58 +0300 |
commit | a8a92cd15a5251377474fbfdcf9ff0298a8457a9 (patch) | |
tree | e706390707e62180be921b2f2de03fcb8793303e /source/blender/editors/gpencil/gpencil_utils.c | |
parent | ce359da5b3ac98c9f7cfd6593cc1769ec3b7247b (diff) |
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
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_utils.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 5c041134a74..574670de7ca 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -596,6 +596,21 @@ bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const return true; } +/* Check whether given stroke is visible for the current material. */ +bool ED_gpencil_stroke_material_visible(Object *ob, const bGPDstroke *gps) +{ + /* check if the color is editable */ + MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1); + + if (gp_style != NULL) { + if (gp_style->flag & GP_MATERIAL_HIDE) { + return false; + } + } + + return true; +} + /* ******************************************************** */ /* Space Conversion */ |