Brush: Add writing and reading ID preview for Brushes.

Mandatory change for the Brush Assets project, from quick test does not
seem to break anything (more) in existing 'old' brushes...

Re. #101908.

Pull Request #105016
This commit is contained in:
Bastien Montagne
2023-02-21 12:03:26 +01:00
committed by Gitea
parent fdf6252b5a
commit a91c6e71db

View File

@@ -263,6 +263,8 @@ static void brush_blend_write(BlendWriter *writer, ID *id, const void *id_addres
if (brush->gradient) {
BLO_write_struct(writer, ColorBand, brush->gradient);
}
BKE_previewimg_blend_write(writer, brush->preview);
}
static void brush_blend_read_data(BlendDataReader *reader, ID *id)
@@ -348,7 +350,9 @@ static void brush_blend_read_data(BlendDataReader *reader, ID *id)
}
}
brush->preview = nullptr;
BLO_read_data_address(reader, &brush->preview);
BKE_previewimg_blend_read(reader, brush->preview);
brush->icon_imbuf = nullptr;
}