Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_particle.c
| Show First 20 Lines • Show All 689 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void rna_Particle_change_type(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Particle_change_type(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| ParticleSettings *part = (ParticleSettings *)ptr->owner_id; | ParticleSettings *part = (ParticleSettings *)ptr->owner_id; | ||||
| /* Iterating over all object is slow, but no better solution exists at the moment. */ | /* Iterating over all object is slow, but no better solution exists at the moment. */ | ||||
| for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { | for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { | ||||
| for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) { | LISTBASE_FOREACH (ParticleSystem *, psys, &ob->particlesystem) { | ||||
| if (psys->part == part) { | if (psys->part == part) { | ||||
| psys_changed_type(ob, psys); | psys_changed_type(ob, psys); | ||||
| psys->recalc |= ID_RECALC_PSYS_RESET; | psys->recalc |= ID_RECALC_PSYS_RESET; | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,261 Lines • Show Last 20 Lines | |||||