DNA: Move irradiance grid light cache data to Object level #106808

Merged
Clément Foucault merged 13 commits from fclem/blender:lightprobe-data into main 2023-04-17 17:12:31 +02:00
1 changed files with 8 additions and 0 deletions
Showing only changes of commit e3e5f6efb4 - Show all commits

View File

@ -156,6 +156,14 @@ static void lightprobe_grid_cache_frame_blend_write(BlendWriter *writer,
static void lightprobe_grid_cache_frame_blend_read(BlendDataReader *reader,
LightProbeGridCacheFrame *cache)
{
if (!ELEM(cache->data_layout,
LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION,
LIGHTPROBE_CACHE_UNIFORM_GRID)) {
/* Do not try to read data from incompatible layout. Clear all pointers. */
memset(cache, 0, sizeof(*cache));
return;
}
BLO_read_data_address(reader, &cache->block_infos);
int64_t sample_count = BKE_lightprobe_grid_cache_frame_sample_count(cache);