Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-06-16 17:59:52 +0300
committerJacques Lucke <jacques@blender.org>2020-06-16 17:59:52 +0300
commitd3de5d7ca5608c53418ce4284cefe7e7d66a6b33 (patch)
treef60179f320cb8e1529e822c1de61b1c1602bcee7 /source/blender/blenloader
parent4365de38700ccc05f98f601efdde0963de4645c1 (diff)
Refactor: Move curvemapping .blend read/write to blenkernel
This is necessary so that it can be accessed from `blendWrite` and `blendRead` callbacks from modifiers.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c11
-rw-r--r--source/blender/blenloader/intern/writefile.c9
2 files changed, 4 insertions, 16 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f3b92b1f6a4..2e7532c5b46 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2887,16 +2887,7 @@ static void direct_link_id_common(
/* cuma itself has been read! */
static void direct_link_curvemapping(BlendDataReader *reader, CurveMapping *cumap)
{
- int a;
-
- /* flag seems to be able to hang? Maybe old files... not bad to clear anyway */
- cumap->flag &= ~CUMA_PREMULLED;
-
- for (a = 0; a < CM_TOT; a++) {
- BLO_read_data_address(reader, &cumap->cm[a].curve);
- cumap->cm[a].table = NULL;
- cumap->cm[a].premultable = NULL;
- }
+ BKE_curvemapping_blend_read(reader, cumap);
}
/** \} */
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 2cc6cecd815..909a12a48aa 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -155,6 +155,7 @@
#include "BKE_blender_version.h"
#include "BKE_bpath.h"
#include "BKE_collection.h"
+#include "BKE_colortools.h"
#include "BKE_constraint.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
@@ -969,16 +970,12 @@ static void write_animdata(BlendWriter *writer, AnimData *adt)
static void write_curvemapping_curves(BlendWriter *writer, CurveMapping *cumap)
{
- for (int a = 0; a < CM_TOT; a++) {
- BLO_write_struct_array(writer, CurveMapPoint, cumap->cm[a].totpoint, cumap->cm[a].curve);
- }
+ BKE_curvemapping_curves_blend_write(writer, cumap);
}
static void write_curvemapping(BlendWriter *writer, CurveMapping *cumap)
{
- BLO_write_struct(writer, CurveMapping, cumap);
-
- write_curvemapping_curves(writer, cumap);
+ BKE_curvemapping_blend_write(writer, cumap);
}
static void write_CurveProfile(BlendWriter *writer, CurveProfile *profile)