[Bf-blender-cvs] [0a7e29739d1] functions: Merge branch 'master' into functions
Jacques Lucke
noreply at git.blender.org
Thu Nov 21 16:16:01 CET 2019
Commit: 0a7e29739d1c46d68f2dfdafe2df7abce75bbb91
Author: Jacques Lucke
Date: Thu Nov 21 15:55:44 2019 +0100
Branches: functions
https://developer.blender.org/rB0a7e29739d1c46d68f2dfdafe2df7abce75bbb91
Merge branch 'master' into functions
===================================================================
===================================================================
diff --cc source/blender/blenloader/intern/readfile.c
index e336a5f4c48,f6c1cd0380a..595e71eff57
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -5802,30 -5817,13 +5817,37 @@@ static void direct_link_modifiers(FileD
}
}
}
+ else if (md->type == eModifierType_BParticles) {
+ BParticlesModifierData *bpmd = (BParticlesModifierData *)md;
+ bpmd->cached_frames = newdataadr(fd, bpmd->cached_frames);
+
+ for (uint frame_index = 0; frame_index < bpmd->num_cached_frames; frame_index++) {
+ BParticlesFrameCache *cached_frame = &bpmd->cached_frames[frame_index];
+ cached_frame->particle_types = newdataadr(fd, cached_frame->particle_types);
+
+ for (uint type = 0; type < cached_frame->num_particle_types; type++) {
+ BParticlesTypeCache *cached_type = &cached_frame->particle_types[type];
+ cached_type->attributes_float = newdataadr(fd, cached_type->attributes_float);
+
+ for (uint i = 0; i < cached_type->num_attributes_float; i++) {
+ BParticlesAttributeCacheFloat *cached_attribute = &cached_type->attributes_float[i];
+ cached_attribute->values = newdataadr(fd, cached_attribute->values);
+
+ if (fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
+ BLI_endian_switch_float_array(cached_attribute->values,
+ cached_type->particle_amount);
+ }
+ }
+ }
+ }
+ }
+ else if (md->type == eModifierType_Bevel) {
+ BevelModifierData *bmd = (BevelModifierData *)md;
+ bmd->custom_profile = newdataadr(fd, bmd->custom_profile);
+ if (bmd->custom_profile) {
+ direct_link_curveprofile(fd, bmd->custom_profile);
+ }
+ }
}
}
diff --cc source/blender/blenloader/intern/writefile.c
index 8ed8fb25b86,3390d30ad5d..df7fa4f565f
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -1759,37 -1766,12 +1766,43 @@@ static void write_modifiers(WriteData *
}
}
}
+ else if (md->type == eModifierType_BParticles) {
+ BParticlesModifierData *bpmd = (BParticlesModifierData *)md;
+ writestruct(wd, DATA, BParticlesFrameCache, bpmd->num_cached_frames, bpmd->cached_frames);
+
+ for (uint frame_index = 0; frame_index < bpmd->num_cached_frames; frame_index++) {
+ BParticlesFrameCache *cached_frame = &bpmd->cached_frames[frame_index];
+ writestruct(wd,
+ DATA,
+ BParticlesTypeCache,
+ cached_frame->num_particle_types,
+ cached_frame->particle_types);
+
+ for (uint type = 0; type < cached_frame->num_particle_types; type++) {
+ BParticlesTypeCache *cached_type = &cached_frame->particle_types[type];
+ writestruct(wd,
+ DATA,
+ BParticlesAttributeCacheFloat,
+ cached_type->num_attributes_float,
+ cached_type->attributes_float);
+
+ for (uint i = 0; i < cached_type->num_attributes_float; i++) {
+ BParticlesAttributeCacheFloat *attribute_cache = &cached_type->attributes_float[i];
+ writedata(wd,
+ DATA,
+ sizeof(float) * attribute_cache->floats_per_particle *
+ cached_type->particle_amount,
+ attribute_cache->values);
+ }
+ }
+ }
+ }
+ else if (md->type == eModifierType_Bevel) {
+ BevelModifierData *bmd = (BevelModifierData *)md;
+ if (bmd->custom_profile) {
+ write_CurveProfile(wd, bmd->custom_profile);
+ }
+ }
}
}
More information about the Bf-blender-cvs
mailing list