[Bf-blender-cvs] [7c5d6d6074e] soc-2020-greasepencil-curve: GPencil: Fix read/load of bGPDcurve.

Falk David noreply at git.blender.org
Fri Jun 5 10:23:08 CEST 2020


Commit: 7c5d6d6074ed90f8c7969b66ee0ff4785876c376
Author: Falk David
Date:   Fri Jun 5 10:21:57 2020 +0200
Branches: soc-2020-greasepencil-curve
https://developer.blender.org/rB7c5d6d6074ed90f8c7969b66ee0ff4785876c376

GPencil: Fix read/load of bGPDcurve.

Remove unnessesary code when reading bGPDcurve struct.
Fix the size of array when writing bGPDCurve struct.

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

M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d0c979f71ec..cffcc188ab9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11614,13 +11614,6 @@ static void expand_gpencil(FileData *fd, Main *mainvar, bGPdata *gpd)
 {
   LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
     expand_doit(fd, mainvar, gpl->parent);
-    LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
-      LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
-        if ((gps->editcurve != NULL) && (gps->editcurve->curve_points != NULL)) {
-          expand_doit(fd, mainvar, gps->editcurve->curve_points);
-        }
-      }
-    }
   }
 
   for (int a = 0; a < gpd->totcol; a++) {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ffa3c768693..6fbee9d0c32 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2894,10 +2894,14 @@ static void write_gpencil(WriteData *wd, bGPdata *gpd, const void *id_address)
           writestruct(wd, DATA, bGPDspoint, gps->totpoints, gps->points);
           writestruct(wd, DATA, bGPDtriangle, gps->tot_triangles, gps->triangles);
           if (gps->editcurve != NULL) {
-            writestruct(wd, DATA, BezTriple, gps->editcurve->tot_curve_points, gps->editcurve->curve_points);
+            writestruct(wd,
+                        DATA,
+                        BezTriple,
+                        gps->editcurve->tot_curve_points,
+                        gps->editcurve->curve_points);
             writedata(wd,
                       DATA,
-                      sizeof(int *) * gps->editcurve->tot_curve_points,
+                      sizeof(int) * gps->editcurve->tot_curve_points,
                       gps->editcurve->point_index_array);
           }
           write_dverts(wd, gps->totpoints, gps->dvert);



More information about the Bf-blender-cvs mailing list