I’ve started working on a patch for this, but am facing some (what I thought trivial) issue: The View Layer could contain characters that are not allowed by external applications like Nuke. In fact, spaces are also converted on import to underscores for the metadata. An obvious fix for this would be to swap out spaces with underscores for the metadata, but that could yield unwanted results: What if a user had a view layer called “View Layer” and at the same time a view layer called “View_Layer” in the scene? Just blindly swapping characters could generate larger turmoil in the long run here.
Needless to say, this problem only affects Nuke (and maybe AfterEffects via ProEXR, I don’t have that so can not test). Fusion reads the EXRs Blender produces today just fine, how to get to the metadata there is beyond me, but I don’t see that this would be necessary either in Fusion.
Regardless of the issue above, does Blender already have a C++ function somewhere in the source code to replace characters in a string by passing a list of invalid characters to it? One that I could re-use in the code?