[Bf-blender-cvs] [7d4aee6ed0e] temp-gpencil-io: Fix error when exporting several objects

Antonio Vazquez noreply at git.blender.org
Wed Mar 3 17:06:43 CET 2021


Commit: 7d4aee6ed0e17e2ae253c54ab06aca1c94c061da
Author: Antonio Vazquez
Date:   Wed Mar 3 17:03:35 2021 +0100
Branches: temp-gpencil-io
https://developer.blender.org/rB7d4aee6ed0e17e2ae253c54ab06aca1c94c061da

Fix error when exporting several objects

The matrix was wrong

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

M	source/blender/io/gpencil/intern/gpencil_io_base.cc
M	source/blender/io/gpencil/intern/gpencil_io_base.h
M	source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_svg.cc

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

diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc
index c18020ab587..24aa00bbef8 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_base.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc
@@ -370,9 +370,9 @@ void GpencilIO::rgb_to_grayscale(float color[3])
   color[2] = grayscale;
 }
 
-void GpencilIO::gpl_matrix_set(struct bGPDlayer *gpl)
+void GpencilIO::gpl_matrix_set(struct Object *ob, struct bGPDlayer *gpl)
 {
-  BKE_gpencil_layer_transform_matrix_get(depsgraph_, params_.ob, gpl, diff_mat_);
+  BKE_gpencil_layer_transform_matrix_get(depsgraph_, ob, gpl, diff_mat_);
   mul_m4_m4m4(diff_mat_, diff_mat_, gpl->layer_invmat);
 }
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.h b/source/blender/io/gpencil/intern/gpencil_io_base.h
index dfaba7c40e3..dbd3d1517db 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_base.h
+++ b/source/blender/io/gpencil/intern/gpencil_io_base.h
@@ -104,7 +104,7 @@ class GpencilIO {
 
   float stroke_average_opacity_get(void);
 
-  void gpl_matrix_set(struct bGPDlayer *gpl);
+  void gpl_matrix_set(struct Object *ob, struct bGPDlayer *gpl);
   void gps_current_color_set(struct Object *ob, struct bGPDstroke *gps);
 
   void selected_objects_boundbox_set(void);
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
index a3dcf0e857d..4121b77eb73 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
@@ -166,7 +166,7 @@ void GpencilExporterPDF::export_gpencil_layers(void)
       if (gpl->flag & GP_LAYER_HIDE) {
         continue;
       }
-      gpl_matrix_set(gpl);
+      gpl_matrix_set(ob, gpl);
 
       bGPDframe *gpf = gpl->actframe;
       if ((gpf == nullptr) || (gpf->strokes.first == nullptr)) {
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
index 63a56f15ee4..d403fd5116d 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
@@ -184,7 +184,7 @@ void GpencilExporterSVG::export_gpencil_layers(void)
       if (gpl->flag & GP_LAYER_HIDE) {
         continue;
       }
-      gpl_matrix_set(gpl);
+      gpl_matrix_set(ob, gpl);
 
       bGPDframe *gpf = gpl->actframe;
       if ((gpf == nullptr) || (gpf->strokes.first == nullptr)) {



More information about the Bf-blender-cvs mailing list