diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-23 17:42:00 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-23 17:42:08 +0300 |
commit | 8b59b97c10ecbab6e1062335d1c376b4c0fb9879 (patch) | |
tree | b175be884162253f69b7a40d33c72affc12e8df2 /source/blender/modifiers/intern/MOD_warp.c | |
parent | f7bbc7cdbb6cb0d28504c6a8dd51bee5330d1f17 (diff) |
Refactor: move more blenloader code into modifier files
Diffstat (limited to 'source/blender/modifiers/intern/MOD_warp.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_warp.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index b32efa3fb8f..2b67b26e620 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -49,6 +49,8 @@ #include "UI_interface.h" #include "UI_resources.h" +#include "BLO_read_write.h" + #include "RNA_access.h" #include "DEG_depsgraph.h" @@ -510,6 +512,25 @@ static void panelRegister(ARegionType *region_type) region_type, "texture", "Texture", NULL, texture_panel_draw, panel_type); } +static void blendWrite(BlendWriter *writer, const ModifierData *md) +{ + const WarpModifierData *tmd = (const WarpModifierData *)md; + + if (tmd->curfalloff) { + BKE_curvemapping_blend_write(writer, tmd->curfalloff); + } +} + +static void blendRead(BlendDataReader *reader, ModifierData *md) +{ + WarpModifierData *tmd = (WarpModifierData *)md; + + BLO_read_data_address(reader, &tmd->curfalloff); + if (tmd->curfalloff) { + BKE_curvemapping_blend_read(reader, tmd->curfalloff); + } +} + ModifierTypeInfo modifierType_Warp = { /* name */ "Warp", /* structName */ "WarpModifierData", @@ -540,6 +561,6 @@ ModifierTypeInfo modifierType_Warp = { /* foreachTexLink */ foreachTexLink, /* freeRuntimeData */ NULL, /* panelRegister */ panelRegister, - /* blendWrite */ NULL, - /* blendRead */ NULL, + /* blendWrite */ blendWrite, + /* blendRead */ blendRead, }; |