diff options
Diffstat (limited to 'source/blender/blenkernel/intern/pointcloud.cc')
-rw-r--r-- | source/blender/blenkernel/intern/pointcloud.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/pointcloud.cc b/source/blender/blenkernel/intern/pointcloud.cc index 3ee46fc4f15..9720c61e3b9 100644 --- a/source/blender/blenkernel/intern/pointcloud.cc +++ b/source/blender/blenkernel/intern/pointcloud.cc @@ -20,6 +20,7 @@ #include "BLI_string.h" #include "BLI_task.hh" #include "BLI_utildefines.h" +#include "BLI_vector.hh" #include "BKE_anim_data.h" #include "BKE_customdata.h" @@ -44,6 +45,7 @@ using blender::float3; using blender::IndexRange; using blender::Span; +using blender::Vector; /* PointCloud datablock */ @@ -107,27 +109,25 @@ static void pointcloud_blend_write(BlendWriter *writer, ID *id, const void *id_a { PointCloud *pointcloud = (PointCloud *)id; - CustomDataLayer *players = nullptr, players_buff[CD_TEMP_CHUNK_SIZE]; - CustomData_blend_write_prepare( - &pointcloud->pdata, &players, players_buff, ARRAY_SIZE(players_buff)); + Vector<CustomDataLayer, 16> point_layers; + CustomData_blend_write_prepare(pointcloud->pdata, point_layers); /* Write LibData */ BLO_write_id_struct(writer, PointCloud, id_address, &pointcloud->id); BKE_id_blend_write(writer, &pointcloud->id); /* Direct data */ - CustomData_blend_write( - writer, &pointcloud->pdata, players, pointcloud->totpoint, CD_MASK_ALL, &pointcloud->id); + CustomData_blend_write(writer, + &pointcloud->pdata, + point_layers, + pointcloud->totpoint, + CD_MASK_ALL, + &pointcloud->id); BLO_write_pointer_array(writer, pointcloud->totcol, pointcloud->mat); if (pointcloud->adt) { BKE_animdata_blend_write(writer, pointcloud->adt); } - - /* Remove temporary data. */ - if (players && players != players_buff) { - MEM_freeN(players); - } } static void pointcloud_blend_read_data(BlendDataReader *reader, ID *id) |