|
From: | Peter Hillman |
Subject: | Re: [Openexr-devel] Loss of layer names in GetChannelsInMultiPartFile() |
Date: | Wed, 14 Sep 2016 09:55:34 +1200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hi Phil, GetChannelsInMultiPartFile() is something I wrote, based around an assumed standard for how channels would be split across multi-part files. Unfortunately Nuke doesn't use that convention. It also doesn't
follow the OpenEXR standard, writing red, green and blue as
"R","G","B" unless they are from Nuke's "rgba" layer. The RgbaFile
API will not read any data from that file. That largely makes GetChannelsInMultiPartFile rather redundant. You'll need to roll your own scheme. Perhaps a good algorithm would be to check if the same channel name appears multiple times in the file. If it does, then treat the part name as the layer name, extracting the view name from the part name (plus any surrounding characters that look like separators). You'll also need to rename any variants of red, green and blue to RGB. If each view has uniquely named channels, use GetChannelsInMultiPartFile For the record, the "standard" I was assuming writing GetChannelsInMultiPartFile is:
Secondary occurrences of the same channel would be alternative representations or "non-standard" schemes. For example, you might store the same data in both scanline and tiled format in separate parts within the same file, or you might store a multilayer composited image as well as the individual elements within the same file. Those schemes would generally be used "in-house" - I wouldn't expect commercial software to understand how to handle those extra channels unless it created the file itself. By default tools would only read the first occurrence of a channel. It may be necessary to offer an "advanced" UI which allows the user to select which EXR channels to read from which (named) parts and how to map those to the internal channels within the software. I regret not enforcing the GetChannelsInMultiPartFile convention
more deeply in the code - we wanted to allow for flexibility but
ended up leaving too much room for confusion. Peter p.s. (*) disconnected parts and layer like this is a particularly
powerful feature for performance and quality: you can store just
RGB in part 0, A in part 1, then all your 'rarely used' layers in
part 2. This means playback performance critical systems (like
Baselight!) can skip the extra layers if they aren't needed. It
will often not need the alpha channel, which might be stored using
a different compression scheme than RGB to make the file smaller,
or to allow lossy compression on RGB but not A. Storing all the
'rarely used' layers together might help to compress them smaller
as the compression can exploit similarities between the channels.
I've seen good compromise between file size and performance by
storing RGB uncompressed in part 0, then compressing everything
else including A in part 1. The approach of using part names for
layer names doesn't allow for this.
On 14/09/16 02:25, Phil Barrett wrote:
Hi there |
[Prev in Thread] | Current Thread | [Next in Thread] |