diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-16 18:04:03 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-16 18:04:03 +0300 |
commit | 25a1ed993a794d67ee1624cdcfba0f1dc5ffb200 (patch) | |
tree | a1c849af4a481d2374e7f2c84df2d3ea8a2498b5 /source/blender/blenloader | |
parent | d3de5d7ca5608c53418ce4284cefe7e7d66a6b33 (diff) |
Cleanup: remove unnecessary indirection for .blend read/write of curvemapping
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 108 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 115 |
2 files changed, 103 insertions, 120 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2e7532c5b46..e72cad47c0a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2881,18 +2881,6 @@ static void direct_link_id_common( /** \} */ /* -------------------------------------------------------------------- */ -/** \name Read CurveMapping - * \{ */ - -/* cuma itself has been read! */ -static void direct_link_curvemapping(BlendDataReader *reader, CurveMapping *cumap) -{ - BKE_curvemapping_blend_read(reader, cumap); -} - -/** \} */ - -/* -------------------------------------------------------------------- */ /** \name Read CurveProfile * \{ */ @@ -2945,7 +2933,7 @@ static void direct_link_brush(BlendDataReader *reader, Brush *brush) BLO_read_data_address(reader, &brush->gradient); if (brush->curve) { - direct_link_curvemapping(reader, brush->curve); + BKE_curvemapping_blend_read(reader, brush->curve); } else { BKE_brush_curve_preset(brush, CURVE_PRESET_SHARP); @@ -2966,39 +2954,39 @@ static void direct_link_brush(BlendDataReader *reader, Brush *brush) BLO_read_data_address(reader, &brush->gpencil_settings->curve_rand_value); if (brush->gpencil_settings->curve_sensitivity) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_sensitivity); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_sensitivity); } if (brush->gpencil_settings->curve_strength) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_strength); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_strength); } if (brush->gpencil_settings->curve_jitter) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_jitter); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_jitter); } if (brush->gpencil_settings->curve_rand_pressure) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_rand_pressure); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_rand_pressure); } if (brush->gpencil_settings->curve_rand_strength) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_rand_strength); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_rand_strength); } if (brush->gpencil_settings->curve_rand_uv) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_rand_uv); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_rand_uv); } if (brush->gpencil_settings->curve_rand_hue) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_rand_hue); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_rand_hue); } if (brush->gpencil_settings->curve_rand_saturation) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_rand_saturation); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_rand_saturation); } if (brush->gpencil_settings->curve_rand_value) { - direct_link_curvemapping(reader, brush->gpencil_settings->curve_rand_value); + BKE_curvemapping_blend_read(reader, brush->gpencil_settings->curve_rand_value); } } @@ -3711,7 +3699,7 @@ static void direct_link_nodetree(BlendDataReader *reader, bNodeTree *ntree) case CMP_NODE_HUECORRECT: case TEX_NODE_CURVE_RGB: case TEX_NODE_CURVE_TIME: { - direct_link_curvemapping(reader, node->storage); + BKE_curvemapping_blend_read(reader, node->storage); break; } case SH_NODE_SCRIPT: { @@ -4091,7 +4079,7 @@ static void direct_link_light(BlendDataReader *reader, Light *la) BLO_read_data_address(reader, &la->curfalloff); if (la->curfalloff) { - direct_link_curvemapping(reader, la->curfalloff); + BKE_curvemapping_blend_read(reader, la->curfalloff); } la->preview = direct_link_preview_image(reader, la->preview); @@ -4703,15 +4691,15 @@ static void direct_link_particlesettings(BlendDataReader *reader, ParticleSettin BLO_read_data_address(reader, &part->clumpcurve); if (part->clumpcurve) { - direct_link_curvemapping(reader, part->clumpcurve); + BKE_curvemapping_blend_read(reader, part->clumpcurve); } BLO_read_data_address(reader, &part->roughcurve); if (part->roughcurve) { - direct_link_curvemapping(reader, part->roughcurve); + BKE_curvemapping_blend_read(reader, part->roughcurve); } BLO_read_data_address(reader, &part->twistcurve); if (part->twistcurve) { - direct_link_curvemapping(reader, part->twistcurve); + BKE_curvemapping_blend_read(reader, part->twistcurve); } BLO_read_data_address(reader, &part->effector_weights); @@ -5771,7 +5759,7 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object BLO_read_data_address(reader, &hmd->curfalloff); if (hmd->curfalloff) { - direct_link_curvemapping(reader, hmd->curfalloff); + BKE_curvemapping_blend_read(reader, hmd->curfalloff); } } else if (md->type == eModifierType_ParticleSystem) { @@ -5811,7 +5799,7 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object BLO_read_data_address(reader, &tmd->curfalloff); if (tmd->curfalloff) { - direct_link_curvemapping(reader, tmd->curfalloff); + BKE_curvemapping_blend_read(reader, tmd->curfalloff); } } else if (md->type == eModifierType_WeightVGEdit) { @@ -5819,7 +5807,7 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object BLO_read_data_address(reader, &wmd->cmap_curve); if (wmd->cmap_curve) { - direct_link_curvemapping(reader, wmd->cmap_curve); + BKE_curvemapping_blend_read(reader, wmd->cmap_curve); } } else if (md->type == eModifierType_CorrectiveSmooth) { @@ -5902,7 +5890,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) BLO_read_data_address(reader, &hmd->curfalloff); if (hmd->curfalloff) { - direct_link_curvemapping(reader, hmd->curfalloff); + BKE_curvemapping_blend_read(reader, hmd->curfalloff); } } else if (md->type == eGpencilModifierType_Noise) { @@ -5910,7 +5898,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) BLO_read_data_address(reader, &gpmd->curve_intensity); if (gpmd->curve_intensity) { - direct_link_curvemapping(reader, gpmd->curve_intensity); + BKE_curvemapping_blend_read(reader, gpmd->curve_intensity); /* initialize the curve. Maybe this could be moved to modififer logic */ BKE_curvemapping_initialize(gpmd->curve_intensity); } @@ -5920,7 +5908,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) BLO_read_data_address(reader, &gpmd->curve_thickness); if (gpmd->curve_thickness) { - direct_link_curvemapping(reader, gpmd->curve_thickness); + BKE_curvemapping_blend_read(reader, gpmd->curve_thickness); BKE_curvemapping_initialize(gpmd->curve_thickness); } } @@ -5929,7 +5917,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) BLO_read_data_address(reader, &gpmd->colorband); BLO_read_data_address(reader, &gpmd->curve_intensity); if (gpmd->curve_intensity) { - direct_link_curvemapping(reader, gpmd->curve_intensity); + BKE_curvemapping_blend_read(reader, gpmd->curve_intensity); BKE_curvemapping_initialize(gpmd->curve_intensity); } } @@ -5937,7 +5925,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) SmoothGpencilModifierData *gpmd = (SmoothGpencilModifierData *)md; BLO_read_data_address(reader, &gpmd->curve_intensity); if (gpmd->curve_intensity) { - direct_link_curvemapping(reader, gpmd->curve_intensity); + BKE_curvemapping_blend_read(reader, gpmd->curve_intensity); BKE_curvemapping_initialize(gpmd->curve_intensity); } } @@ -5945,7 +5933,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) ColorGpencilModifierData *gpmd = (ColorGpencilModifierData *)md; BLO_read_data_address(reader, &gpmd->curve_intensity); if (gpmd->curve_intensity) { - direct_link_curvemapping(reader, gpmd->curve_intensity); + BKE_curvemapping_blend_read(reader, gpmd->curve_intensity); BKE_curvemapping_initialize(gpmd->curve_intensity); } } @@ -5953,7 +5941,7 @@ static void direct_link_gpencil_modifiers(BlendDataReader *reader, ListBase *lb) OpacityGpencilModifierData *gpmd = (OpacityGpencilModifierData *)md; BLO_read_data_address(reader, &gpmd->curve_intensity); if (gpmd->curve_intensity) { - direct_link_curvemapping(reader, gpmd->curve_intensity); + BKE_curvemapping_blend_read(reader, gpmd->curve_intensity); BKE_curvemapping_initialize(gpmd->curve_intensity); } } @@ -6187,7 +6175,7 @@ static void direct_link_view_settings(BlendDataReader *reader, BLO_read_data_address(reader, &view_settings->curve_mapping); if (view_settings->curve_mapping) { - direct_link_curvemapping(reader, view_settings->curve_mapping); + BKE_curvemapping_blend_read(reader, view_settings->curve_mapping); } } @@ -6716,7 +6704,7 @@ static void direct_link_paint(BlendDataReader *reader, const Scene *scene, Paint BLO_read_data_address(reader, &p->cavity_curve); if (p->cavity_curve) { - direct_link_curvemapping(reader, p->cavity_curve); + BKE_curvemapping_blend_read(reader, p->cavity_curve); } else { BKE_paint_cavity_curve_preset(p, CURVE_PRESET_LINE); @@ -6758,12 +6746,12 @@ static void direct_link_sequence_modifiers(BlendDataReader *reader, ListBase *lb if (smd->type == seqModifierType_Curves) { CurvesModifierData *cmd = (CurvesModifierData *)smd; - direct_link_curvemapping(reader, &cmd->curve_mapping); + BKE_curvemapping_blend_read(reader, &cmd->curve_mapping); } else if (smd->type == seqModifierType_HueCorrect) { HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd; - direct_link_curvemapping(reader, &hcmd->curve_mapping); + BKE_curvemapping_blend_read(reader, &hcmd->curve_mapping); } } } @@ -6826,17 +6814,17 @@ static void direct_link_scene(BlendDataReader *reader, Scene *sce) /* relink grease pencil interpolation curves */ BLO_read_data_address(reader, &sce->toolsettings->gp_interpolate.custom_ipo); if (sce->toolsettings->gp_interpolate.custom_ipo) { - direct_link_curvemapping(reader, sce->toolsettings->gp_interpolate.custom_ipo); + BKE_curvemapping_blend_read(reader, sce->toolsettings->gp_interpolate.custom_ipo); } /* relink grease pencil multiframe falloff curve */ BLO_read_data_address(reader, &sce->toolsettings->gp_sculpt.cur_falloff); if (sce->toolsettings->gp_sculpt.cur_falloff) { - direct_link_curvemapping(reader, sce->toolsettings->gp_sculpt.cur_falloff); + BKE_curvemapping_blend_read(reader, sce->toolsettings->gp_sculpt.cur_falloff); } /* relink grease pencil primitive curve */ BLO_read_data_address(reader, &sce->toolsettings->gp_sculpt.cur_primitive); if (sce->toolsettings->gp_sculpt.cur_primitive) { - direct_link_curvemapping(reader, sce->toolsettings->gp_sculpt.cur_primitive); + BKE_curvemapping_blend_read(reader, sce->toolsettings->gp_sculpt.cur_primitive); } /* Relink toolsettings curve profile */ @@ -7041,7 +7029,7 @@ static void direct_link_scene(BlendDataReader *reader, Scene *sce) sce->preview = direct_link_preview_image(reader, sce->preview); - direct_link_curvemapping(reader, &sce->r.mblur_shutter_curve); + BKE_curvemapping_blend_read(reader, &sce->r.mblur_shutter_curve); #ifdef USE_COLLECTION_COMPAT_28 /* this runs before the very first doversion */ @@ -8861,51 +8849,51 @@ static void direct_link_linestyle_alpha_modifier(BlendDataReader *reader, case LS_MODIFIER_ALONG_STROKE: { LineStyleAlphaModifier_AlongStroke *m = (LineStyleAlphaModifier_AlongStroke *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_DISTANCE_FROM_CAMERA: { LineStyleAlphaModifier_DistanceFromCamera *m = (LineStyleAlphaModifier_DistanceFromCamera *) modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_DISTANCE_FROM_OBJECT: { LineStyleAlphaModifier_DistanceFromObject *m = (LineStyleAlphaModifier_DistanceFromObject *) modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_MATERIAL: { LineStyleAlphaModifier_Material *m = (LineStyleAlphaModifier_Material *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_TANGENT: { LineStyleAlphaModifier_Tangent *m = (LineStyleAlphaModifier_Tangent *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_NOISE: { LineStyleAlphaModifier_Noise *m = (LineStyleAlphaModifier_Noise *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_CREASE_ANGLE: { LineStyleAlphaModifier_CreaseAngle *m = (LineStyleAlphaModifier_CreaseAngle *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_CURVATURE_3D: { LineStyleAlphaModifier_Curvature_3D *m = (LineStyleAlphaModifier_Curvature_3D *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } } @@ -8919,47 +8907,47 @@ static void direct_link_linestyle_thickness_modifier(BlendDataReader *reader, LineStyleThicknessModifier_AlongStroke *m = (LineStyleThicknessModifier_AlongStroke *) modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_DISTANCE_FROM_CAMERA: { LineStyleThicknessModifier_DistanceFromCamera *m = (LineStyleThicknessModifier_DistanceFromCamera *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_DISTANCE_FROM_OBJECT: { LineStyleThicknessModifier_DistanceFromObject *m = (LineStyleThicknessModifier_DistanceFromObject *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_MATERIAL: { LineStyleThicknessModifier_Material *m = (LineStyleThicknessModifier_Material *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_TANGENT: { LineStyleThicknessModifier_Tangent *m = (LineStyleThicknessModifier_Tangent *)modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_CREASE_ANGLE: { LineStyleThicknessModifier_CreaseAngle *m = (LineStyleThicknessModifier_CreaseAngle *) modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } case LS_MODIFIER_CURVATURE_3D: { LineStyleThicknessModifier_Curvature_3D *m = (LineStyleThicknessModifier_Curvature_3D *) modifier; BLO_read_data_address(reader, &m->curve); - direct_link_curvemapping(reader, m->curve); + BKE_curvemapping_blend_read(reader, m->curve); break; } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 909a12a48aa..fbd11ef5323 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -968,16 +968,6 @@ static void write_animdata(BlendWriter *writer, AnimData *adt) write_nladata(writer, &adt->nla_tracks); } -static void write_curvemapping_curves(BlendWriter *writer, CurveMapping *cumap) -{ - BKE_curvemapping_curves_blend_write(writer, cumap); -} - -static void write_curvemapping(BlendWriter *writer, CurveMapping *cumap) -{ - BKE_curvemapping_blend_write(writer, cumap); -} - static void write_CurveProfile(BlendWriter *writer, CurveProfile *profile) { BLO_write_struct(writer, CurveProfile, profile); @@ -1084,7 +1074,7 @@ static void write_nodetree_nolib(BlendWriter *writer, bNodeTree *ntree) /* could be handlerized at some point, now only 1 exception still */ if ((ntree->type == NTREE_SHADER) && ELEM(node->type, SH_NODE_CURVE_VEC, SH_NODE_CURVE_RGB)) { - write_curvemapping(writer, node->storage); + BKE_curvemapping_blend_write(writer, node->storage); } else if (ntree->type == NTREE_SHADER && (node->type == SH_NODE_SCRIPT)) { NodeShaderScript *nss = (NodeShaderScript *)node->storage; @@ -1098,11 +1088,11 @@ static void write_nodetree_nolib(BlendWriter *writer, bNodeTree *ntree) CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, CMP_NODE_HUECORRECT)) { - write_curvemapping(writer, node->storage); + BKE_curvemapping_blend_write(writer, node->storage); } else if ((ntree->type == NTREE_TEXTURE) && (node->type == TEX_NODE_CURVE_RGB || node->type == TEX_NODE_CURVE_TIME)) { - write_curvemapping(writer, node->storage); + BKE_curvemapping_blend_write(writer, node->storage); } else if ((ntree->type == NTREE_COMPOSIT) && (node->type == CMP_NODE_MOVIEDISTORTION)) { /* pass */ @@ -1433,13 +1423,13 @@ static void write_particlesettings(BlendWriter *writer, BLO_write_struct(writer, EffectorWeights, part->effector_weights); if (part->clumpcurve) { - write_curvemapping(writer, part->clumpcurve); + BKE_curvemapping_blend_write(writer, part->clumpcurve); } if (part->roughcurve) { - write_curvemapping(writer, part->roughcurve); + BKE_curvemapping_blend_write(writer, part->roughcurve); } if (part->twistcurve) { - write_curvemapping(writer, part->twistcurve); + BKE_curvemapping_blend_write(writer, part->twistcurve); } LISTBASE_FOREACH (ParticleDupliWeight *, dw, &part->instance_weights) { @@ -1680,7 +1670,7 @@ static void write_modifiers(BlendWriter *writer, ListBase *modbase) HookModifierData *hmd = (HookModifierData *)md; if (hmd->curfalloff) { - write_curvemapping(writer, hmd->curfalloff); + BKE_curvemapping_blend_write(writer, hmd->curfalloff); } BLO_write_int32_array(writer, hmd->totindex, hmd->indexar); @@ -1781,14 +1771,14 @@ static void write_modifiers(BlendWriter *writer, ListBase *modbase) else if (md->type == eModifierType_Warp) { WarpModifierData *tmd = (WarpModifierData *)md; if (tmd->curfalloff) { - write_curvemapping(writer, tmd->curfalloff); + BKE_curvemapping_blend_write(writer, tmd->curfalloff); } } else if (md->type == eModifierType_WeightVGEdit) { WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md; if (wmd->cmap_curve) { - write_curvemapping(writer, wmd->cmap_curve); + BKE_curvemapping_blend_write(writer, wmd->cmap_curve); } } else if (md->type == eModifierType_CorrectiveSmooth) { @@ -1858,21 +1848,21 @@ static void write_gpencil_modifiers(BlendWriter *writer, ListBase *modbase) ThickGpencilModifierData *gpmd = (ThickGpencilModifierData *)md; if (gpmd->curve_thickness) { - write_curvemapping(writer, gpmd->curve_thickness); + BKE_curvemapping_blend_write(writer, gpmd->curve_thickness); } } else if (md->type == eGpencilModifierType_Noise) { NoiseGpencilModifierData *gpmd = (NoiseGpencilModifierData *)md; if (gpmd->curve_intensity) { - write_curvemapping(writer, gpmd->curve_intensity); + BKE_curvemapping_blend_write(writer, gpmd->curve_intensity); } } else if (md->type == eGpencilModifierType_Hook) { HookGpencilModifierData *gpmd = (HookGpencilModifierData *)md; if (gpmd->curfalloff) { - write_curvemapping(writer, gpmd->curfalloff); + BKE_curvemapping_blend_write(writer, gpmd->curfalloff); } } else if (md->type == eGpencilModifierType_Tint) { @@ -1881,25 +1871,25 @@ static void write_gpencil_modifiers(BlendWriter *writer, ListBase *modbase) BLO_write_struct(writer, ColorBand, gpmd->colorband); } if (gpmd->curve_intensity) { - write_curvemapping(writer, gpmd->curve_intensity); + BKE_curvemapping_blend_write(writer, gpmd->curve_intensity); } } else if (md->type == eGpencilModifierType_Smooth) { SmoothGpencilModifierData *gpmd = (SmoothGpencilModifierData *)md; if (gpmd->curve_intensity) { - write_curvemapping(writer, gpmd->curve_intensity); + BKE_curvemapping_blend_write(writer, gpmd->curve_intensity); } } else if (md->type == eGpencilModifierType_Color) { ColorGpencilModifierData *gpmd = (ColorGpencilModifierData *)md; if (gpmd->curve_intensity) { - write_curvemapping(writer, gpmd->curve_intensity); + BKE_curvemapping_blend_write(writer, gpmd->curve_intensity); } } else if (md->type == eGpencilModifierType_Opacity) { OpacityGpencilModifierData *gpmd = (OpacityGpencilModifierData *)md; if (gpmd->curve_intensity) { - write_curvemapping(writer, gpmd->curve_intensity); + BKE_curvemapping_blend_write(writer, gpmd->curve_intensity); } } } @@ -2454,7 +2444,7 @@ static void write_light(BlendWriter *writer, Light *la, const void *id_address) } if (la->curfalloff) { - write_curvemapping(writer, la->curfalloff); + BKE_curvemapping_blend_write(writer, la->curfalloff); } /* Node-tree is integral part of lights, no libdata. */ @@ -2511,12 +2501,12 @@ static void write_sequence_modifiers(BlendWriter *writer, ListBase *modbase) if (smd->type == seqModifierType_Curves) { CurvesModifierData *cmd = (CurvesModifierData *)smd; - write_curvemapping(writer, &cmd->curve_mapping); + BKE_curvemapping_blend_write(writer, &cmd->curve_mapping); } else if (smd->type == seqModifierType_HueCorrect) { HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd; - write_curvemapping(writer, &hcmd->curve_mapping); + BKE_curvemapping_blend_write(writer, &hcmd->curve_mapping); } } else { @@ -2528,7 +2518,7 @@ static void write_sequence_modifiers(BlendWriter *writer, ListBase *modbase) static void write_view_settings(BlendWriter *writer, ColorManagedViewSettings *view_settings) { if (view_settings->curve_mapping) { - write_curvemapping(writer, view_settings->curve_mapping); + BKE_curvemapping_blend_write(writer, view_settings->curve_mapping); } } @@ -2542,7 +2532,7 @@ static void write_view3dshading(BlendWriter *writer, View3DShading *shading) static void write_paint(BlendWriter *writer, Paint *p) { if (p->cavity_curve) { - write_curvemapping(writer, p->cavity_curve); + BKE_curvemapping_blend_write(writer, p->cavity_curve); } BLO_write_struct_array(writer, PaintToolSlot, p->tool_slots_len, p->tool_slots); } @@ -2659,15 +2649,15 @@ static void write_scene(BlendWriter *writer, Scene *sce, const void *id_address) } /* write grease-pencil custom ipo curve to file */ if (tos->gp_interpolate.custom_ipo) { - write_curvemapping(writer, tos->gp_interpolate.custom_ipo); + BKE_curvemapping_blend_write(writer, tos->gp_interpolate.custom_ipo); } /* write grease-pencil multiframe falloff curve to file */ if (tos->gp_sculpt.cur_falloff) { - write_curvemapping(writer, tos->gp_sculpt.cur_falloff); + BKE_curvemapping_blend_write(writer, tos->gp_sculpt.cur_falloff); } /* write grease-pencil primitive curve to file */ if (tos->gp_sculpt.cur_primitive) { - write_curvemapping(writer, tos->gp_sculpt.cur_primitive); + BKE_curvemapping_blend_write(writer, tos->gp_sculpt.cur_primitive); } /* Write the curve profile to the file. */ if (tos->custom_bevel_profile_preset) { @@ -2813,7 +2803,7 @@ static void write_scene(BlendWriter *writer, Scene *sce, const void *id_address) } write_previews(writer, sce->preview); - write_curvemapping_curves(writer, &sce->r.mblur_shutter_curve); + BKE_curvemapping_curves_blend_write(writer, &sce->r.mblur_shutter_curve); LISTBASE_FOREACH (ViewLayer *, view_layer, &sce->view_layers) { write_view_layer(writer, view_layer); @@ -3317,38 +3307,38 @@ static void write_brush(BlendWriter *writer, Brush *brush, const void *id_addres write_iddata(writer, &brush->id); if (brush->curve) { - write_curvemapping(writer, brush->curve); + BKE_curvemapping_blend_write(writer, brush->curve); } if (brush->gpencil_settings) { BLO_write_struct(writer, BrushGpencilSettings, brush->gpencil_settings); if (brush->gpencil_settings->curve_sensitivity) { - write_curvemapping(writer, brush->gpencil_settings->curve_sensitivity); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_sensitivity); } if (brush->gpencil_settings->curve_strength) { - write_curvemapping(writer, brush->gpencil_settings->curve_strength); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_strength); } if (brush->gpencil_settings->curve_jitter) { - write_curvemapping(writer, brush->gpencil_settings->curve_jitter); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_jitter); } if (brush->gpencil_settings->curve_rand_pressure) { - write_curvemapping(writer, brush->gpencil_settings->curve_rand_pressure); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_pressure); } if (brush->gpencil_settings->curve_rand_strength) { - write_curvemapping(writer, brush->gpencil_settings->curve_rand_strength); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_strength); } if (brush->gpencil_settings->curve_rand_uv) { - write_curvemapping(writer, brush->gpencil_settings->curve_rand_uv); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_uv); } if (brush->gpencil_settings->curve_rand_hue) { - write_curvemapping(writer, brush->gpencil_settings->curve_rand_hue); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_hue); } if (brush->gpencil_settings->curve_rand_saturation) { - write_curvemapping(writer, brush->gpencil_settings->curve_rand_saturation); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_saturation); } if (brush->gpencil_settings->curve_rand_value) { - write_curvemapping(writer, brush->gpencil_settings->curve_rand_value); + BKE_curvemapping_blend_write(writer, brush->gpencil_settings->curve_rand_value); } } if (brush->gradient) { @@ -3609,28 +3599,30 @@ static void write_linestyle_alpha_modifiers(BlendWriter *writer, ListBase *modif for (m = modifiers->first; m; m = m->next) { switch (m->type) { case LS_MODIFIER_ALONG_STROKE: - write_curvemapping(writer, ((LineStyleAlphaModifier_AlongStroke *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleAlphaModifier_AlongStroke *)m)->curve); break; case LS_MODIFIER_DISTANCE_FROM_CAMERA: - write_curvemapping(writer, ((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve); + BKE_curvemapping_blend_write(writer, + ((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve); break; case LS_MODIFIER_DISTANCE_FROM_OBJECT: - write_curvemapping(writer, ((LineStyleAlphaModifier_DistanceFromObject *)m)->curve); + BKE_curvemapping_blend_write(writer, + ((LineStyleAlphaModifier_DistanceFromObject *)m)->curve); break; case LS_MODIFIER_MATERIAL: - write_curvemapping(writer, ((LineStyleAlphaModifier_Material *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleAlphaModifier_Material *)m)->curve); break; case LS_MODIFIER_TANGENT: - write_curvemapping(writer, ((LineStyleAlphaModifier_Tangent *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleAlphaModifier_Tangent *)m)->curve); break; case LS_MODIFIER_NOISE: - write_curvemapping(writer, ((LineStyleAlphaModifier_Noise *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleAlphaModifier_Noise *)m)->curve); break; case LS_MODIFIER_CREASE_ANGLE: - write_curvemapping(writer, ((LineStyleAlphaModifier_CreaseAngle *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleAlphaModifier_CreaseAngle *)m)->curve); break; case LS_MODIFIER_CURVATURE_3D: - write_curvemapping(writer, ((LineStyleAlphaModifier_Curvature_3D *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleAlphaModifier_Curvature_3D *)m)->curve); break; } } @@ -3678,25 +3670,28 @@ static void write_linestyle_thickness_modifiers(BlendWriter *writer, ListBase *m for (m = modifiers->first; m; m = m->next) { switch (m->type) { case LS_MODIFIER_ALONG_STROKE: - write_curvemapping(writer, ((LineStyleThicknessModifier_AlongStroke *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleThicknessModifier_AlongStroke *)m)->curve); break; case LS_MODIFIER_DISTANCE_FROM_CAMERA: - write_curvemapping(writer, ((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve); + BKE_curvemapping_blend_write(writer, + ((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve); break; case LS_MODIFIER_DISTANCE_FROM_OBJECT: - write_curvemapping(writer, ((LineStyleThicknessModifier_DistanceFromObject *)m)->curve); + BKE_curvemapping_blend_write(writer, + ((LineStyleThicknessModifier_DistanceFromObject *)m)->curve); break; case LS_MODIFIER_MATERIAL: - write_curvemapping(writer, ((LineStyleThicknessModifier_Material *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleThicknessModifier_Material *)m)->curve); break; case LS_MODIFIER_TANGENT: - write_curvemapping(writer, ((LineStyleThicknessModifier_Tangent *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleThicknessModifier_Tangent *)m)->curve); break; case LS_MODIFIER_CREASE_ANGLE: - write_curvemapping(writer, ((LineStyleThicknessModifier_CreaseAngle *)m)->curve); + BKE_curvemapping_blend_write(writer, ((LineStyleThicknessModifier_CreaseAngle *)m)->curve); break; case LS_MODIFIER_CURVATURE_3D: - write_curvemapping(writer, ((LineStyleThicknessModifier_Curvature_3D *)m)->curve); + BKE_curvemapping_blend_write(writer, + ((LineStyleThicknessModifier_Curvature_3D *)m)->curve); break; } } |