Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 491 Lines • ▼ Show 20 Lines | for (psys = object->particlesystem.first; psys != NULL; psys = psys->next) { | ||||
| update_flag |= ID_RECALC_PSYS_REDO; | update_flag |= ID_RECALC_PSYS_REDO; | ||||
| } | } | ||||
| } | } | ||||
| /* Free memory used by cached derived meshes in the particle system modifiers. */ | /* Free memory used by cached derived meshes in the particle system modifiers. */ | ||||
| for (md = object->modifiers.first; md != NULL; md = md->next) { | for (md = object->modifiers.first; md != NULL; md = md->next) { | ||||
| if (md->type == eModifierType_ParticleSystem) { | if (md->type == eModifierType_ParticleSystem) { | ||||
| ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md; | ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md; | ||||
| if (psmd->mesh_final) { | ParticleSystemModifierDataRuntime *psmd_runtime = BKE_particle_modifier_runtime_ensure(psmd); | ||||
| BKE_id_free(NULL, psmd->mesh_final); | if (psmd_runtime->mesh_final) { | ||||
| psmd->mesh_final = NULL; | BKE_id_free(NULL, psmd_runtime->mesh_final); | ||||
| if (psmd->mesh_original) { | psmd_runtime->mesh_final = NULL; | ||||
| BKE_id_free(NULL, psmd->mesh_original); | if (psmd_runtime->mesh_original) { | ||||
| psmd->mesh_original = NULL; | BKE_id_free(NULL, psmd_runtime->mesh_original); | ||||
| psmd_runtime->mesh_original = NULL; | |||||
| } | } | ||||
| psmd->flag |= eParticleSystemFlag_file_loaded; | psmd->flag |= eParticleSystemFlag_file_loaded; | ||||
| update_flag |= ID_RECALC_GEOMETRY; | update_flag |= ID_RECALC_GEOMETRY; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* NOTE: If object is coming from a duplicator, it might be a temporary | /* NOTE: If object is coming from a duplicator, it might be a temporary | ||||
| ▲ Show 20 Lines • Show All 3,949 Lines • Show Last 20 Lines | |||||