Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_fluidsim.c
| Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| /* remove fluidsim particle system */ | /* remove fluidsim particle system */ | ||||
| if (fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) { | if (fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) { | ||||
| for (psys = ob->particlesystem.first; psys; psys = psys->next) | for (psys = ob->particlesystem.first; psys; psys = psys->next) | ||||
| if (psys->part->type == PART_FLUID) | if (psys->part->type == PART_FLUID) | ||||
| break; | break; | ||||
| if (ob->type == OB_MESH && !psys) { | if (ob->type == OB_MESH && !psys) { | ||||
| /* add particle system */ | /* add particle system */ | ||||
| part = psys_new_settings("ParticleSettings", bmain); | part = psys_new_settings("ParticleSettings", bmain, PART_FLUID); | ||||
| psys = MEM_callocN(sizeof(ParticleSystem), "particle_system"); | psys = MEM_callocN(sizeof(ParticleSystem), "particle_system"); | ||||
| part->type = PART_FLUID; | |||||
| psys->part = part; | psys->part = part; | ||||
| psys->pointcache = BKE_ptcache_add(&psys->ptcaches); | psys->pointcache = BKE_ptcache_add(&psys->ptcaches); | ||||
| BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name)); | BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name)); | ||||
| BLI_addtail(&ob->particlesystem, psys); | BLI_addtail(&ob->particlesystem, psys); | ||||
| /* add modifier */ | /* add modifier */ | ||||
| psmd = (ParticleSystemModifierData *)modifier_new(eModifierType_ParticleSystem); | psmd = (ParticleSystemModifierData *)modifier_new(eModifierType_ParticleSystem); | ||||
| BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name)); | BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name)); | ||||
| ▲ Show 20 Lines • Show All 576 Lines • Show Last 20 Lines | |||||