Improvements and fixes to Cycles metadata
This is a request by the studio here to make it possible to see how many samples were used to render a specific shot or a frame. It is a bit more tricky than simply stamping number of samples from a scene since rendering is happening in multiple ranges of samples.
This change makes it so Cycles saves configured number of samples for the specific view layer, and also stores start sample and number of samples when rendering only a subrange of all samples.
The format used is "cycles.<view_layer_name>.><field>", which allows to have information about all layers in a multi-layer EXR file. Ideally we can store simplified "cycles.<field>" if we know that there is only one render layer in the file, but detecting this is somewhat tricky since Cycles operates on an evaluated scene which always have single view layer.
The metadata is shown in the Metadata panels for clip, image and sequencer spaces.
Example screenshot which shows the metadata: