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 17:42:00 +0300
committerJacques Lucke <jacques@blender.org>2020-06-23 17:42:08 +0300
commit8b59b97c10ecbab6e1062335d1c376b4c0fb9879 (patch)
treeb175be884162253f69b7a40d33c72affc12e8df2 /source/blender/modifiers
parentf7bbc7cdbb6cb0d28504c6a8dd51bee5330d1f17 (diff)
Refactor: move more blenloader code into modifier files
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_correctivesmooth.c28
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c29
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c25
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c25
4 files changed, 99 insertions, 8 deletions
diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c
index ba343854d41..ac91056ed7d 100644
--- a/source/blender/modifiers/intern/MOD_correctivesmooth.c
+++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c
@@ -54,6 +54,8 @@
#include "MOD_ui_common.h"
#include "MOD_util.h"
+#include "BLO_read_write.h"
+
#include "BLI_strict_flags.h"
#include "DEG_depsgraph_query.h"
@@ -817,6 +819,28 @@ static void panelRegister(ARegionType *region_type)
modifier_panel_register(region_type, eModifierType_CorrectiveSmooth, panel_draw);
}
+static void blendWrite(BlendWriter *writer, const ModifierData *md)
+{
+ const CorrectiveSmoothModifierData *csmd = (const CorrectiveSmoothModifierData *)md;
+
+ if (csmd->bind_coords) {
+ BLO_write_float3_array(writer, (int)csmd->bind_coords_num, (float *)csmd->bind_coords);
+ }
+}
+
+static void blendRead(BlendDataReader *reader, ModifierData *md)
+{
+ CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)md;
+
+ if (csmd->bind_coords) {
+ BLO_read_float3_array(reader, (int)csmd->bind_coords_num, (float **)&csmd->bind_coords);
+ }
+
+ /* runtime only */
+ csmd->delta_cache.deltas = NULL;
+ csmd->delta_cache.totverts = 0;
+}
+
ModifierTypeInfo modifierType_CorrectiveSmooth = {
/* name */ "CorrectiveSmooth",
/* structName */ "CorrectiveSmoothModifierData",
@@ -847,6 +871,6 @@ ModifierTypeInfo modifierType_CorrectiveSmooth = {
/* foreachTexLink */ NULL,
/* freeRuntimeData */ NULL,
/* panelRegister */ panelRegister,
- /* blendWrite */ NULL,
- /* blendRead */ NULL,
+ /* blendWrite */ blendWrite,
+ /* blendRead */ blendRead,
};
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 4305c32071d..c8cfc07562f 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -46,6 +46,8 @@
#include "UI_interface.h"
#include "UI_resources.h"
+#include "BLO_read_write.h"
+
#include "RNA_access.h"
#include "DEG_depsgraph_query.h"
@@ -468,6 +470,29 @@ static void panelRegister(ARegionType *region_type)
region_type, "falloff", "Falloff", NULL, falloff_panel_draw, panel_type);
}
+static void blendWrite(BlendWriter *writer, const ModifierData *md)
+{
+ const HookModifierData *hmd = (const HookModifierData *)md;
+
+ if (hmd->curfalloff) {
+ BKE_curvemapping_blend_write(writer, hmd->curfalloff);
+ }
+
+ BLO_write_int32_array(writer, hmd->totindex, hmd->indexar);
+}
+
+static void blendRead(BlendDataReader *reader, ModifierData *md)
+{
+ HookModifierData *hmd = (HookModifierData *)md;
+
+ BLO_read_data_address(reader, &hmd->curfalloff);
+ if (hmd->curfalloff) {
+ BKE_curvemapping_blend_read(reader, hmd->curfalloff);
+ }
+
+ BLO_read_int32_array(reader, hmd->totindex, &hmd->indexar);
+}
+
ModifierTypeInfo modifierType_Hook = {
/* name */ "Hook",
/* structName */ "HookModifierData",
@@ -498,6 +523,6 @@ ModifierTypeInfo modifierType_Hook = {
/* foreachTexLink */ NULL,
/* freeRuntimeData */ NULL,
/* panelRegister */ panelRegister,
- /* blendWrite */ NULL,
- /* blendRead */ NULL,
+ /* blendWrite */ blendWrite,
+ /* blendRead */ blendRead,
};
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,
};
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index 9dfc2f653cd..8039856172a 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -47,6 +47,8 @@
#include "UI_interface.h"
#include "UI_resources.h"
+#include "BLO_read_write.h"
+
#include "RNA_access.h"
#include "DEG_depsgraph_build.h"
@@ -399,6 +401,25 @@ static void panelRegister(ARegionType *region_type)
region_type, "influence", "Influence", NULL, influence_panel_draw, panel_type);
}
+static void blendWrite(BlendWriter *writer, const ModifierData *md)
+{
+ const WeightVGEditModifierData *wmd = (const WeightVGEditModifierData *)md;
+
+ if (wmd->cmap_curve) {
+ BKE_curvemapping_blend_write(writer, wmd->cmap_curve);
+ }
+}
+
+static void blendRead(BlendDataReader *reader, ModifierData *md)
+{
+ WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md;
+
+ BLO_read_data_address(reader, &wmd->cmap_curve);
+ if (wmd->cmap_curve) {
+ BKE_curvemapping_blend_read(reader, wmd->cmap_curve);
+ }
+}
+
ModifierTypeInfo modifierType_WeightVGEdit = {
/* name */ "VertexWeightEdit",
/* structName */ "WeightVGEditModifierData",
@@ -430,6 +451,6 @@ ModifierTypeInfo modifierType_WeightVGEdit = {
/* foreachTexLink */ foreachTexLink,
/* freeRuntimeData */ NULL,
/* panelRegister */ panelRegister,
- /* blendWrite */ NULL,
- /* blendRead */ NULL,
+ /* blendWrite */ blendWrite,
+ /* blendRead */ blendRead,
};