diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-13 12:28:30 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-13 12:28:59 +0300 |
commit | de9c7bae7b9e7c66584531953c5acae274c013c2 (patch) | |
tree | 737bb6e21a171f636ae2ae8d1fbeb2afb82f93b9 /source/blender/blenloader | |
parent | df032580c170d9f5e508b34673b84a14f8808990 (diff) |
GPencil: Join Tint and Vertex Color modifier
Both are doing almost the same and can be merged. This reduce complexity for user and less code to maintain.
Reviewed By: mendio, pepeland, fclem
Differential Revision: https://developer.blender.org/D7134
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 12 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 21 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 10 |
3 files changed, 6 insertions, 37 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 49b51c34562..dadae3a938a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5774,8 +5774,8 @@ static void direct_link_gpencil_modifiers(FileData *fd, ListBase *lb) BKE_curvemapping_initialize(gpmd->curve_thickness); } } - else if (md->type == eGpencilModifierType_Vertexcolor) { - VertexcolorGpencilModifierData *gpmd = (VertexcolorGpencilModifierData *)md; + else if (md->type == eGpencilModifierType_Tint) { + TintGpencilModifierData *gpmd = (TintGpencilModifierData *)md; gpmd->colorband = newdataadr(fd, gpmd->colorband); gpmd->curve_intensity = newdataadr(fd, gpmd->curve_intensity); if (gpmd->curve_intensity) { @@ -5799,14 +5799,6 @@ static void direct_link_gpencil_modifiers(FileData *fd, ListBase *lb) BKE_curvemapping_initialize(gpmd->curve_intensity); } } - else if (md->type == eGpencilModifierType_Tint) { - TintGpencilModifierData *gpmd = (TintGpencilModifierData *)md; - gpmd->curve_intensity = newdataadr(fd, gpmd->curve_intensity); - if (gpmd->curve_intensity) { - direct_link_curvemapping(fd, gpmd->curve_intensity); - BKE_curvemapping_initialize(gpmd->curve_intensity); - } - } else if (md->type == eGpencilModifierType_Opacity) { OpacityGpencilModifierData *gpmd = (OpacityGpencilModifierData *)md; gpmd->curve_intensity = newdataadr(fd, gpmd->curve_intensity); diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index d0659bfd34c..7d727e81882 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1068,8 +1068,8 @@ static void do_version_curvemapping_walker(Main *bmain, void (*callback)(CurveMa callback(gpmd->curve_intensity); } } - else if (md->type == eGpencilModifierType_Vertexcolor) { - VertexcolorGpencilModifierData *gpmd = (VertexcolorGpencilModifierData *)md; + else if (md->type == eGpencilModifierType_Tint) { + TintGpencilModifierData *gpmd = (TintGpencilModifierData *)md; if (gpmd->curve_intensity) { callback(gpmd->curve_intensity); @@ -1096,13 +1096,6 @@ static void do_version_curvemapping_walker(Main *bmain, void (*callback)(CurveMa callback(gpmd->curve_intensity); } } - else if (md->type == eGpencilModifierType_Tint) { - TintGpencilModifierData *gpmd = (TintGpencilModifierData *)md; - - if (gpmd->curve_intensity) { - callback(gpmd->curve_intensity); - } - } } } @@ -4728,16 +4721,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } break; } - case eGpencilModifierType_Vertexcolor: { - VertexcolorGpencilModifierData *mmd = (VertexcolorGpencilModifierData *)md; - if (mmd->curve_intensity == NULL) { - mmd->curve_intensity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); - if (mmd->curve_intensity) { - BKE_curvemapping_initialize(mmd->curve_intensity); - } - } - break; - } default: break; } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index a9c5008062b..a92404b2372 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1844,8 +1844,8 @@ static void write_gpencil_modifiers(WriteData *wd, ListBase *modbase) write_curvemapping(wd, gpmd->curfalloff); } } - else if (md->type == eGpencilModifierType_Vertexcolor) { - VertexcolorGpencilModifierData *gpmd = (VertexcolorGpencilModifierData *)md; + else if (md->type == eGpencilModifierType_Tint) { + TintGpencilModifierData *gpmd = (TintGpencilModifierData *)md; if (gpmd->colorband) { writestruct(wd, DATA, ColorBand, 1, gpmd->colorband); } @@ -1871,12 +1871,6 @@ static void write_gpencil_modifiers(WriteData *wd, ListBase *modbase) 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); - } - } } } |