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-23 18:02:49 +0300
committerJacques Lucke <jacques@blender.org>2020-06-23 18:08:39 +0300
commit56f95297754dae0562c107737fd3e8a85b9c34df (patch)
tree5e3e5fdb6bc5de9a8f34f15933c871282a379993 /source/blender/blenloader
parentf345625ded0ac3507c69160654360ebe8a463c84 (diff)
Refactor: move blenloader code of curve profile to blenkernel
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c18
-rw-r--r--source/blender/blenloader/intern/writefile.c11
2 files changed, 6 insertions, 23 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 8c02b067d35..e90849fdf18 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -118,6 +118,7 @@
#include "BKE_colortools.h"
#include "BKE_constraint.h"
#include "BKE_curve.h"
+#include "BKE_curveprofile.h"
#include "BKE_effect.h"
#include "BKE_fcurve_driver.h"
#include "BKE_fluid.h"
@@ -2881,19 +2882,6 @@ static void direct_link_id_common(
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Read CurveProfile
- * \{ */
-
-static void direct_link_curveprofile(BlendDataReader *reader, CurveProfile *profile)
-{
- BLO_read_data_address(reader, &profile->path);
- profile->table = NULL;
- profile->segments = NULL;
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name Read ID: Brush
* \{ */
@@ -5781,7 +5769,7 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object
BevelModifierData *bmd = (BevelModifierData *)md;
BLO_read_data_address(reader, &bmd->custom_profile);
if (bmd->custom_profile) {
- direct_link_curveprofile(reader, bmd->custom_profile);
+ BKE_curveprofile_blend_read(reader, bmd->custom_profile);
}
}
@@ -6754,7 +6742,7 @@ static void direct_link_scene(BlendDataReader *reader, Scene *sce)
/* Relink toolsettings curve profile */
BLO_read_data_address(reader, &sce->toolsettings->custom_bevel_profile_preset);
if (sce->toolsettings->custom_bevel_profile_preset) {
- direct_link_curveprofile(reader, sce->toolsettings->custom_bevel_profile_preset);
+ BKE_curveprofile_blend_read(reader, sce->toolsettings->custom_bevel_profile_preset);
}
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 8f87ff78ab5..898e43a2c44 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -158,6 +158,7 @@
#include "BKE_colortools.h"
#include "BKE_constraint.h"
#include "BKE_curve.h"
+#include "BKE_curveprofile.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_global.h" // for G
@@ -968,12 +969,6 @@ static void write_animdata(BlendWriter *writer, AnimData *adt)
write_nladata(writer, &adt->nla_tracks);
}
-static void write_CurveProfile(BlendWriter *writer, CurveProfile *profile)
-{
- BLO_write_struct(writer, CurveProfile, profile);
- BLO_write_struct_array(writer, CurveProfilePoint, profile->path_len, profile->path);
-}
-
static void write_node_socket_default_value(BlendWriter *writer, bNodeSocket *sock)
{
if (sock->default_value == NULL) {
@@ -1751,7 +1746,7 @@ static void write_modifiers(BlendWriter *writer, ListBase *modbase)
else if (md->type == eModifierType_Bevel) {
BevelModifierData *bmd = (BevelModifierData *)md;
if (bmd->custom_profile) {
- write_CurveProfile(writer, bmd->custom_profile);
+ BKE_curveprofile_blend_write(writer, bmd->custom_profile);
}
}
@@ -2594,7 +2589,7 @@ static void write_scene(BlendWriter *writer, Scene *sce, const void *id_address)
}
/* Write the curve profile to the file. */
if (tos->custom_bevel_profile_preset) {
- write_CurveProfile(writer, tos->custom_bevel_profile_preset);
+ BKE_curveprofile_blend_write(writer, tos->custom_bevel_profile_preset);
}
write_paint(writer, &tos->imapaint.paint);