Render: use "_" as delimiter in AOV names to avoid issues with OpenEXR

OpenEXR uses "." to separate layers/passes/channels, so using AOV.001 is
a problem. Other applications will not be able to parse it correctly.

Default to AOV_001 instead, and don't allow using dots in AOV names.

Fixes T89991
Ref T73266
Ref D12871
This commit is contained in:
Brecht Van Lommel 2021-10-19 12:13:27 +02:00
parent 6ee181ec24
commit 8e8932c8ff
Notes: blender-bot 2023-02-14 08:28:46 +01:00
Referenced by issue #89991, image datablocks fail to import multilayer exr layers that have a dot in the name.
Referenced by issue #73266, Improve custom shader AOVs
1 changed files with 5 additions and 1 deletions

View File

@ -2380,8 +2380,12 @@ static void viewlayer_aov_make_name_unique(ViewLayer *view_layer)
if (aov == NULL) {
return;
}
/* Don't allow dots, it's incompatible with OpenEXR convention to store channels
* as "layer.pass.channel". */
BLI_str_replace_char(aov->name, '.', '_');
BLI_uniquename(
&view_layer->aovs, aov, DATA_("AOV"), '.', offsetof(ViewLayerAOV, name), sizeof(aov->name));
&view_layer->aovs, aov, DATA_("AOV"), '_', offsetof(ViewLayerAOV, name), sizeof(aov->name));
}
static void viewlayer_aov_active_set(ViewLayer *view_layer, ViewLayerAOV *aov)