[Bf-blender-cvs] [4695e1c6627] gpencil-new-data-proposal: add grease pencil data statistics in build function
Amelie Fondevilla
noreply at git.blender.org
Tue Nov 29 10:27:44 CET 2022
Commit: 4695e1c662771c754bc7ba1b7fedb514bcc3328b
Author: Amelie Fondevilla
Date: Thu Nov 24 14:42:33 2022 +0100
Branches: gpencil-new-data-proposal
https://developer.blender.org/rB4695e1c662771c754bc7ba1b7fedb514bcc3328b
add grease pencil data statistics in build function
===================================================================
M source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc b/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
index 630a297469a..f15eb03e8b8 100644
--- a/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
+++ b/source/blender/blenkernel/intern/gpencil_new_proposal_test.cc
@@ -55,6 +55,7 @@ static bGPdata *build_old_gpencil_data(int num_layers,
{
bGPdata *gpd = reinterpret_cast<bGPdata *>(MEM_mallocN(sizeof(bGPdata), __func__));
BLI_listbase_clear(&gpd->layers);
+ gpd->totlayer = gpd->totframe = gpd->totstroke = 0;
for (int i = 0; i < num_layers; i++) {
bGPDlayer *gpl = reinterpret_cast<bGPDlayer *>(MEM_mallocN(sizeof(bGPDlayer), __func__));
sprintf(gpl->info, "%s%d", "GPLayer", i);
@@ -85,10 +86,13 @@ static bGPdata *build_old_gpencil_data(int num_layers,
BLI_addtail(&gpf->strokes, gps);
}
+ gpd->totstroke += strokes_per_frame;
BLI_addtail(&gpl->frames, gpf);
}
+ gpd->totframe += frames_per_layer;
BLI_addtail(&gpd->layers, gpl);
}
+ gpd->totlayer += num_layers;
return gpd;
}
More information about the Bf-blender-cvs
mailing list