Merge branch 'blender-v4.1-release'
This commit is contained in:
@@ -5467,6 +5467,8 @@ void CustomData_blend_read(BlendDataReader *reader, CustomData *data, const int
|
||||
|
||||
BLO_read_data_address(reader, &data->external);
|
||||
|
||||
blender::Map<void *, const ImplicitSharingInfo *> sharing_info_by_data;
|
||||
|
||||
int i = 0;
|
||||
while (i < data->totlayer) {
|
||||
CustomDataLayer *layer = &data->layers[i];
|
||||
@@ -5477,12 +5479,24 @@ void CustomData_blend_read(BlendDataReader *reader, CustomData *data, const int
|
||||
layer->sharing_info = nullptr;
|
||||
|
||||
if (CustomData_verify_versions(data, i)) {
|
||||
layer->sharing_info = BLO_read_shared(reader, &layer->data, [&]() {
|
||||
blend_read_layer_data(reader, *layer, count);
|
||||
return layer->data ? make_implicit_sharing_info_for_layer(
|
||||
eCustomDataType(layer->type), layer->data, count) :
|
||||
nullptr;
|
||||
});
|
||||
layer->sharing_info = BLO_read_shared(
|
||||
reader, &layer->data, [&]() -> const ImplicitSharingInfo * {
|
||||
blend_read_layer_data(reader, *layer, count);
|
||||
if (layer->data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
const ImplicitSharingInfo *sharing_info = sharing_info_by_data.lookup_default(
|
||||
layer->data, nullptr);
|
||||
if (sharing_info != nullptr) {
|
||||
sharing_info->add_user();
|
||||
}
|
||||
else {
|
||||
sharing_info = make_implicit_sharing_info_for_layer(
|
||||
eCustomDataType(layer->type), layer->data, count);
|
||||
sharing_info_by_data.add(layer->data, sharing_info);
|
||||
}
|
||||
return sharing_info;
|
||||
});
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user