diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-09 18:27:24 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-09 18:27:24 +0300 |
commit | 29f3af95272590d26f610ae828b2eeee89c82a00 (patch) | |
tree | a696a58a2561c48f7ec6166e369e22081e0a64d8 /source/blender/blenloader/intern/writefile.c | |
parent | dcb93126876879d969a30a7865700abd072066f8 (diff) |
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 0c9363043ee..81df00ebdef 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1830,6 +1830,13 @@ static void write_gpencil_modifiers(WriteData *wd, ListBase *modbase) write_curvemapping(wd, gpmd->curve_thickness); } } + else if (md->type == eGpencilModifierType_Noise) { + NoiseGpencilModifierData *gpmd = (NoiseGpencilModifierData *)md; + + if (gpmd->curve_intensity) { + write_curvemapping(wd, gpmd->curve_intensity); + } + } else if (md->type == eGpencilModifierType_Hook) { HookGpencilModifierData *gpmd = (HookGpencilModifierData *)md; @@ -1837,6 +1844,39 @@ static void write_gpencil_modifiers(WriteData *wd, ListBase *modbase) write_curvemapping(wd, gpmd->curfalloff); } } + else if (md->type == eGpencilModifierType_Vertexcolor) { + VertexcolorGpencilModifierData *gpmd = (VertexcolorGpencilModifierData *)md; + if (gpmd->colorband) { + writestruct(wd, DATA, ColorBand, 1, gpmd->colorband); + } + if (gpmd->curve_intensity) { + write_curvemapping(wd, gpmd->curve_intensity); + } + } + else if (md->type == eGpencilModifierType_Smooth) { + SmoothGpencilModifierData *gpmd = (SmoothGpencilModifierData *)md; + if (gpmd->curve_intensity) { + write_curvemapping(wd, gpmd->curve_intensity); + } + } + else if (md->type == eGpencilModifierType_Color) { + ColorGpencilModifierData *gpmd = (ColorGpencilModifierData *)md; + if (gpmd->curve_intensity) { + write_curvemapping(wd, gpmd->curve_intensity); + } + } + else if (md->type == eGpencilModifierType_Opacity) { + OpacityGpencilModifierData *gpmd = (OpacityGpencilModifierData *)md; + if (gpmd->curve_intensity) { + write_curvemapping(wd, gpmd->curve_intensity); + } + } + else if (md->type == eGpencilModifierType_Tint) { + TintGpencilModifierData *gpmd = (TintGpencilModifierData *)md; + if (gpmd->curve_intensity) { + write_curvemapping(wd, gpmd->curve_intensity); + } + } } } @@ -2546,6 +2586,18 @@ static void write_scene(WriteData *wd, Scene *sce) writestruct(wd, DATA, GpPaint, 1, tos->gp_paint); write_paint(wd, &tos->gp_paint->paint); } + if (tos->gp_vertexpaint) { + writestruct(wd, DATA, GpVertexPaint, 1, tos->gp_vertexpaint); + write_paint(wd, &tos->gp_vertexpaint->paint); + } + if (tos->gp_sculptpaint) { + writestruct(wd, DATA, GpSculptPaint, 1, tos->gp_sculptpaint); + write_paint(wd, &tos->gp_sculptpaint->paint); + } + if (tos->gp_weightpaint) { + writestruct(wd, DATA, GpWeightPaint, 1, tos->gp_weightpaint); + write_paint(wd, &tos->gp_weightpaint->paint); + } /* write grease-pencil custom ipo curve to file */ if (tos->gp_interpolate.custom_ipo) { write_curvemapping(wd, tos->gp_interpolate.custom_ipo); @@ -2741,14 +2793,17 @@ static void write_gpencil(WriteData *wd, bGPdata *gpd) /* write grease-pencil layers to file */ writelist(wd, DATA, bGPDlayer, &gpd->layers); - for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { + /* Write mask list. */ + writelist(wd, DATA, bGPDlayer_Mask, &gpl->mask_layers); /* write this layer's frames to file */ writelist(wd, DATA, bGPDframe, &gpl->frames); - for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) { + LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { /* write strokes */ writelist(wd, DATA, bGPDstroke, &gpf->strokes); - for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { + LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { writestruct(wd, DATA, bGPDspoint, gps->totpoints, gps->points); + writestruct(wd, DATA, bGPDtriangle, gps->tot_triangles, gps->triangles); write_dverts(wd, gps->totpoints, gps->dvert); } } |