diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-11 12:14:17 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-11 12:14:17 +0300 |
commit | 1b6dd42803df6698b10023ffc660319dab9be502 (patch) | |
tree | f04d660c51a131b6bc048ff0f1047c2ecc297bb3 /source/blender/blenloader/intern/writefile.c | |
parent | 12f33daad708fa2cebd0c73dba4cbbc2189fb567 (diff) |
Refactor: move Hair .blend I/O to IDTypeInfo callbacks
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b9320bb40e3..e8c5e09599c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2104,37 +2104,6 @@ static void write_workspace(BlendWriter *writer, WorkSpace *workspace, const voi } } -static void write_hair(BlendWriter *writer, Hair *hair, const void *id_address) -{ - if (hair->id.us > 0 || BLO_write_is_undo(writer)) { - CustomDataLayer *players = NULL, players_buff[CD_TEMP_CHUNK_SIZE]; - CustomDataLayer *clayers = NULL, clayers_buff[CD_TEMP_CHUNK_SIZE]; - CustomData_blend_write_prepare(&hair->pdata, &players, players_buff, ARRAY_SIZE(players_buff)); - CustomData_blend_write_prepare(&hair->cdata, &clayers, clayers_buff, ARRAY_SIZE(clayers_buff)); - - /* Write LibData */ - BLO_write_id_struct(writer, Hair, id_address, &hair->id); - BKE_id_blend_write(writer, &hair->id); - - /* Direct data */ - CustomData_blend_write(writer, &hair->pdata, players, hair->totpoint, CD_MASK_ALL, &hair->id); - CustomData_blend_write(writer, &hair->cdata, clayers, hair->totcurve, CD_MASK_ALL, &hair->id); - - BLO_write_pointer_array(writer, hair->totcol, hair->mat); - if (hair->adt) { - BKE_animdata_blend_write(writer, hair->adt); - } - - /* Remove temporary data. */ - if (players && players != players_buff) { - MEM_freeN(players); - } - if (clayers && clayers != clayers_buff) { - MEM_freeN(clayers); - } - } -} - static void write_pointcloud(BlendWriter *writer, PointCloud *pointcloud, const void *id_address) { if (pointcloud->id.us > 0 || BLO_write_is_undo(writer)) { @@ -2519,9 +2488,6 @@ static bool write_file_handle(Main *mainvar, case ID_CF: write_cachefile(&writer, (CacheFile *)id_buffer, id); break; - case ID_HA: - write_hair(&writer, (Hair *)id_buffer, id); - break; case ID_PT: write_pointcloud(&writer, (PointCloud *)id_buffer, id); break; @@ -2556,6 +2522,7 @@ static bool write_file_handle(Main *mainvar, case ID_KE: case ID_TE: case ID_GD: + case ID_HA: /* Do nothing, handled in IDTypeInfo callback. */ break; case ID_LI: |