Blenloader: call blendRead and blendWrite of modifiers when available

This is part of T76372.
This commit is contained in:
Jacques Lucke 2020-06-15 17:55:06 +02:00
parent b6981d9e48
commit bf1e5a2133
2 changed files with 12 additions and 1 deletions

View File

@ -5579,8 +5579,11 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object
md = modifier_replace_with_fluid(reader->fd, ob, lb, md);
is_allocated = true;
}
const ModifierTypeInfo *mti = BKE_modifier_get_info(md->type);
/* if modifiers disappear, or for upward compatibility */
if (NULL == BKE_modifier_get_info(md->type)) {
if (mti == NULL) {
md->type = eModifierType_None;
}
@ -5884,6 +5887,10 @@ static void direct_link_modifiers(BlendDataReader *reader, ListBase *lb, Object
direct_link_curveprofile(reader, bmd->custom_profile);
}
}
if (mti->blendRead != NULL) {
mti->blendRead(reader, md);
}
}
}

View File

@ -1839,6 +1839,10 @@ static void write_modifiers(BlendWriter *writer, ListBase *modbase)
write_CurveProfile(writer, bmd->custom_profile);
}
}
if (mti->blendWrite != NULL) {
mti->blendWrite(writer, md);
}
}
}