Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/writefile.c
| Show First 20 Lines • Show All 1,367 Lines • ▼ Show 20 Lines | static const char *ptcache_data_struct[] = { | ||||
| "", // BPHYS_DATA_LOCATION | "", // BPHYS_DATA_LOCATION | ||||
| "", // BPHYS_DATA_VELOCITY | "", // BPHYS_DATA_VELOCITY | ||||
| "", // BPHYS_DATA_ROTATION | "", // BPHYS_DATA_ROTATION | ||||
| "", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */ | "", // BPHYS_DATA_AVELOCITY / BPHYS_DATA_XCONST */ | ||||
| "", // BPHYS_DATA_SIZE: | "", // BPHYS_DATA_SIZE: | ||||
| "", // BPHYS_DATA_TIMES: | "", // BPHYS_DATA_TIMES: | ||||
| "BoidData", // case BPHYS_DATA_BOIDS: | "BoidData", // case BPHYS_DATA_BOIDS: | ||||
| }; | }; | ||||
| static const char *ptcache_extra_struct[] = { | |||||
| "", | |||||
| "ParticleSpring", | |||||
| }; | |||||
| static void write_pointcaches(BlendWriter *writer, ListBase *ptcaches) | static void write_pointcaches(BlendWriter *writer, ListBase *ptcaches) | ||||
| { | { | ||||
| PointCache *cache = ptcaches->first; | PointCache *cache = ptcaches->first; | ||||
| int i; | int i; | ||||
| for (; cache; cache = cache->next) { | for (; cache; cache = cache->next) { | ||||
| BLO_write_struct(writer, PointCache, cache); | BLO_write_struct(writer, PointCache, cache); | ||||
| Show All 13 Lines | if ((cache->flag & PTCACHE_DISK_CACHE) == 0) { | ||||
| else { | else { | ||||
| BLO_write_struct_array_by_name( | BLO_write_struct_array_by_name( | ||||
| writer, ptcache_data_struct[i], pm->totpoint, pm->data[i]); | writer, ptcache_data_struct[i], pm->totpoint, pm->data[i]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| for (; extra; extra = extra->next) { | for (; extra; extra = extra->next) { | ||||
| if (ptcache_extra_struct[extra->type][0] == '\0') { | |||||
| continue; | |||||
| } | |||||
| BLO_write_struct(writer, PTCacheExtra, extra); | BLO_write_struct(writer, PTCacheExtra, extra); | ||||
| switch (extra->type) { | |||||
| case 0: { | |||||
| BLI_assert(false); | |||||
| break; | |||||
| } | |||||
| case BPHYS_EXTRA_FLUID_SPRINGS: { | |||||
| BLO_write_struct_array(writer, ParticleSpring, extra->totdata, extra->data); | |||||
| break; | |||||
| } | |||||
| case BPHYS_EXTRA_CUSTOM_DATA: { | |||||
| BLO_write_string(writer, extra->identifier); | |||||
| const char *struct_name; | |||||
| int struct_num; | |||||
| CustomData_file_write_info(extra->custom_data_type, &struct_name, &struct_num); | |||||
| BLO_write_struct_array_by_name( | BLO_write_struct_array_by_name( | ||||
| writer, ptcache_extra_struct[extra->type], extra->totdata, extra->data); | writer, struct_name, struct_num * extra->totdata, extra->data); | ||||
| break; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void write_particlesettings(BlendWriter *writer, | static void write_particlesettings(BlendWriter *writer, | ||||
| ParticleSettings *part, | ParticleSettings *part, | ||||
| ▲ Show 20 Lines • Show All 3,235 Lines • Show Last 20 Lines | |||||