Refactor: move blenloader code of bevel modifier
This commit is contained in:
parent
56f9529775
commit
9ef5cc44a6
|
@ -5765,13 +5765,6 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object
|
|||
msmcd->reader = NULL;
|
||||
msmcd->reader_object_path[0] = '\0';
|
||||
}
|
||||
else if (md->type == eModifierType_Bevel) {
|
||||
BevelModifierData *bmd = (BevelModifierData *)md;
|
||||
BLO_read_data_address(reader, &bmd->custom_profile);
|
||||
if (bmd->custom_profile) {
|
||||
BKE_curveprofile_blend_read(reader, bmd->custom_profile);
|
||||
}
|
||||
}
|
||||
|
||||
if (mti->blendRead != NULL) {
|
||||
mti->blendRead(reader, md);
|
||||
|
|
|
@ -1743,12 +1743,6 @@ static void write_modifiers(BlendWriter *writer, ListBase *modbase)
|
|||
writestruct(wd, DATA, MFace, collmd->numfaces, collmd->mfaces);
|
||||
#endif
|
||||
}
|
||||
else if (md->type == eModifierType_Bevel) {
|
||||
BevelModifierData *bmd = (BevelModifierData *)md;
|
||||
if (bmd->custom_profile) {
|
||||
BKE_curveprofile_blend_write(writer, bmd->custom_profile);
|
||||
}
|
||||
}
|
||||
|
||||
if (mti->blendWrite != NULL) {
|
||||
mti->blendWrite(writer, md);
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
#include "MOD_ui_common.h"
|
||||
#include "MOD_util.h"
|
||||
|
||||
#include "BLO_read_write.h"
|
||||
|
||||
#include "BKE_curveprofile.h"
|
||||
#include "bmesh.h"
|
||||
#include "bmesh_tools.h"
|
||||
|
@ -413,6 +415,25 @@ static void panelRegister(ARegionType *region_type)
|
|||
region_type, "shading", "Shading", NULL, shading_panel_draw, panel_type);
|
||||
}
|
||||
|
||||
static void blendWrite(BlendWriter *writer, const ModifierData *md)
|
||||
{
|
||||
const BevelModifierData *bmd = (const BevelModifierData *)md;
|
||||
|
||||
if (bmd->custom_profile) {
|
||||
BKE_curveprofile_blend_write(writer, bmd->custom_profile);
|
||||
}
|
||||
}
|
||||
|
||||
static void blendRead(BlendDataReader *reader, ModifierData *md)
|
||||
{
|
||||
BevelModifierData *bmd = (BevelModifierData *)md;
|
||||
|
||||
BLO_read_data_address(reader, &bmd->custom_profile);
|
||||
if (bmd->custom_profile) {
|
||||
BKE_curveprofile_blend_read(reader, bmd->custom_profile);
|
||||
}
|
||||
}
|
||||
|
||||
ModifierTypeInfo modifierType_Bevel = {
|
||||
/* name */ "Bevel",
|
||||
/* structName */ "BevelModifierData",
|
||||
|
@ -441,6 +462,6 @@ ModifierTypeInfo modifierType_Bevel = {
|
|||
/* foreachTexLink */ NULL,
|
||||
/* freeRuntimeData */ NULL,
|
||||
/* uiPanel */ panelRegister,
|
||||
/* blendWrite */ NULL,
|
||||
/* blendRead */ NULL,
|
||||
/* blendWrite */ blendWrite,
|
||||
/* blendRead */ blendRead,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue