Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/modifier.c
| Show First 20 Lines • Show All 1,061 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { | ||||
| } | } | ||||
| BLI_gset_insert(used_uuids, (void *)session_uuid); | BLI_gset_insert(used_uuids, (void *)session_uuid); | ||||
| } | } | ||||
| BLI_gset_free(used_uuids, NULL); | BLI_gset_free(used_uuids, NULL); | ||||
| } | } | ||||
| void BKE_modifier_blend_write(BlendWriter *writer, ListBase *modbase) | void BKE_modifier_blend_write(BlendWriter *writer, const ID *id_owner, ListBase *modbase) | ||||
| { | { | ||||
| if (modbase == NULL) { | if (modbase == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| LISTBASE_FOREACH (ModifierData *, md, modbase) { | LISTBASE_FOREACH (ModifierData *, md, modbase) { | ||||
| const ModifierTypeInfo *mti = BKE_modifier_get_info(md->type); | const ModifierTypeInfo *mti = BKE_modifier_get_info(md->type); | ||||
| if (mti == NULL) { | if (mti == NULL) { | ||||
| return; | continue; | ||||
| } | |||||
| /* If the blendWrite callback is defined, it should handle the whole writing process. */ | |||||
| if (mti->blendWrite != NULL) { | |||||
| mti->blendWrite(writer, id_owner, md); | |||||
| continue; | |||||
| } | } | ||||
| BLO_write_struct_by_name(writer, mti->structName, md); | BLO_write_struct_by_name(writer, mti->structName, md); | ||||
| if (md->type == eModifierType_Cloth) { | if (md->type == eModifierType_Cloth) { | ||||
| ClothModifierData *clmd = (ClothModifierData *)md; | ClothModifierData *clmd = (ClothModifierData *)md; | ||||
| BLO_write_struct(writer, ClothSimSettings, clmd->sim_parms); | BLO_write_struct(writer, ClothSimSettings, clmd->sim_parms); | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | #if 0 | ||||
| CollisionModifierData *collmd = (CollisionModifierData *)md; | CollisionModifierData *collmd = (CollisionModifierData *)md; | ||||
| /* TODO: CollisionModifier should use pointcache | /* TODO: CollisionModifier should use pointcache | ||||
| * + have proper reset events before enabling this. */ | * + have proper reset events before enabling this. */ | ||||
| writestruct(wd, DATA, MVert, collmd->numverts, collmd->x); | writestruct(wd, DATA, MVert, collmd->numverts, collmd->x); | ||||
| writestruct(wd, DATA, MVert, collmd->numverts, collmd->xnew); | writestruct(wd, DATA, MVert, collmd->numverts, collmd->xnew); | ||||
| writestruct(wd, DATA, MFace, collmd->numfaces, collmd->mfaces); | writestruct(wd, DATA, MFace, collmd->numfaces, collmd->mfaces); | ||||
| #endif | #endif | ||||
| } | } | ||||
| if (mti->blendWrite != NULL) { | |||||
| mti->blendWrite(writer, md); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| /* TODO(sergey): Find a better place for this. | /* TODO(sergey): Find a better place for this. | ||||
| * | * | ||||
| * Unfortunately, this can not be done as a regular do_versions() since the modifier type is | * Unfortunately, this can not be done as a regular do_versions() since the modifier type is | ||||
| * set to NONE, so the do_versions code wouldn't know where the modifier came from. | * set to NONE, so the do_versions code wouldn't know where the modifier came from. | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines | |||||