Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-11-06 17:58:27 +0300
committerJacques Lucke <jacques@blender.org>2020-11-06 17:58:39 +0300
commitf6524aaa8093bfc88c658107b8077cd09ac3e989 (patch)
treeb1a8e33f50d4897dcfde1465274787d20c785a41 /source/blender/blenloader/intern/writefile.c
parentba4da217ce631f31adeba5136b5430ffc5fdf1f2 (diff)
Refactor: move ParticleSystem .blend I/O to blenkernel
Ref T76372.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r--source/blender/blenloader/intern/writefile.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 7cce2950a0f..9d6af35f623 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -154,6 +154,7 @@
#include "BKE_object.h"
#include "BKE_packedFile.h"
#include "BKE_paint.h"
+#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_report.h"
#include "BKE_screen.h"
@@ -809,50 +810,6 @@ static void write_userdef(BlendWriter *writer, const UserDef *userdef)
}
}
-static void write_particlesystems(BlendWriter *writer, ListBase *particles)
-{
- LISTBASE_FOREACH (ParticleSystem *, psys, particles) {
- BLO_write_struct(writer, ParticleSystem, psys);
-
- if (psys->particles) {
- BLO_write_struct_array(writer, ParticleData, psys->totpart, psys->particles);
-
- if (psys->particles->hair) {
- ParticleData *pa = psys->particles;
-
- for (int a = 0; a < psys->totpart; a++, pa++) {
- BLO_write_struct_array(writer, HairKey, pa->totkey, pa->hair);
- }
- }
-
- if (psys->particles->boid && (psys->part->phystype == PART_PHYS_BOIDS)) {
- BLO_write_struct_array(writer, BoidParticle, psys->totpart, psys->particles->boid);
- }
-
- if (psys->part->fluid && (psys->part->phystype == PART_PHYS_FLUID) &&
- (psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS)) {
- BLO_write_struct_array(
- writer, ParticleSpring, psys->tot_fluidsprings, psys->fluid_springs);
- }
- }
- LISTBASE_FOREACH (ParticleTarget *, pt, &psys->targets) {
- BLO_write_struct(writer, ParticleTarget, pt);
- }
-
- if (psys->child) {
- BLO_write_struct_array(writer, ChildParticle, psys->totchild, psys->child);
- }
-
- if (psys->clmd) {
- BLO_write_struct(writer, ClothModifierData, psys->clmd);
- BLO_write_struct(writer, ClothSimSettings, psys->clmd->sim_parms);
- BLO_write_struct(writer, ClothCollSettings, psys->clmd->coll_parms);
- }
-
- BKE_ptcache_blend_write(writer, &psys->ptcaches);
- }
-}
-
static void write_motionpath(BlendWriter *writer, bMotionPath *mpath)
{
/* sanity checks */
@@ -1231,7 +1188,7 @@ static void write_object(BlendWriter *writer, Object *ob, const void *id_address
BLO_write_struct(writer, ImageUser, ob->iuser);
}
- write_particlesystems(writer, &ob->particlesystem);
+ BKE_particle_system_blend_write(writer, &ob->particlesystem);
write_modifiers(writer, &ob->modifiers);
write_gpencil_modifiers(writer, &ob->greasepencil_modifiers);
write_shaderfxs(writer, &ob->shader_fx);