Files
test2/source/blender/blenkernel/BKE_attribute_storage_blend_write.hh
Hans Goudey bb8719030d Geometry: Initial replacement of CustomData with AttributeStorage
As described in #122398, implement read and write support for a new
attribute storage system. Currently this is only implemented to support
forward compatibility; the format used at runtime isn't changed at all.
That can be done one step at a time during the 4.5 and 5.0 development
cycles. A new experimental option for testing tells Blender to always
save with the new format.

The main benefit of the new structure is that it matches the attribute
system design, it allows for future attribute storage optimization, and
each attribute is an allocated struct, which will give pointer stability
for the Python API.

The next step is to connect the attribute API and the RNA API to
AttributeStorage for the simplest geometry type, point clouds.

Pull Request: https://projects.blender.org/blender/blender/pulls/133874
2025-05-09 17:27:07 +02:00

27 lines
806 B
C++

/* SPDX-FileCopyrightText: 2025 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "BKE_attribute_storage.hh"
#include "BLI_map.hh"
#include "DNA_customdata_types.h"
namespace blender::bke {
/**
* Prepare an #AttributeStorage struct embedded in another struct to be written. This is necessary
* because the #AttributeStorage implementation doesn't use the DNA structs at runtime, they are
* created just for the writing process. Creating them mutates the struct, which must be done
* before writing the struct that embeds it.
*/
void attribute_storage_blend_write_prepare(
AttributeStorage &data,
const Map<AttrDomain, Vector<CustomDataLayer, 16> *> &layers_to_write,
AttributeStorage::BlendWriteData &write_data);
} // namespace blender::bke