[Bf-blender-cvs] [9b089787464] greasepencil-object: GPencil: Use evaluated strokes for SVG export

Antonio Vazquez noreply at git.blender.org
Sun Jul 26 18:22:09 CEST 2020


Commit: 9b089787464dda4815bfaf89f502084a81f204de
Author: Antonio Vazquez
Date:   Sun Jul 26 17:06:14 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB9b089787464dda4815bfaf89f502084a81f204de

GPencil: Use evaluated strokes for SVG export

Now the SVG includes the strokes with modifiers.

===================================================================

M	source/blender/io/gpencil/intern/gpencil_io_svg.cc

===================================================================

diff --git a/source/blender/io/gpencil/intern/gpencil_io_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_svg.cc
index 2f65ba2d639..3876c8f6653 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_svg.cc
@@ -36,6 +36,9 @@
 #include "DNA_object_types.h"
 #include "DNA_screen_types.h"
 
+#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
+
 #include "ED_gpencil.h"
 
 #ifdef WIN32
@@ -173,7 +176,12 @@ void GpencilExporterSVG::export_layers(void)
   Object *ob = params.ob;
 
   bGPdata *gpd = (bGPdata *)ob->data;
-  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
+
+  /* Use evaluated version to get strokes with modifiers. */
+  Object *ob_eval_ = (Object *)DEG_get_evaluated_id(depsgraph, &ob->id);
+  bGPdata *gpd_eval = (bGPdata *)ob_eval_->data;
+
+  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd_eval->layers) {
     if (gpl->flag & GP_LAYER_HIDE) {
       continue;
     }



More information about the Bf-blender-cvs mailing list