Maya IFF - depth info/map extraction ? #4651
-
I have some IFF generated from Maya that has depth information which I can see using fcheck. Is oiiotool able to convert such IFF files to e.g. OpenEXR, while retaining the depth channel ? What would the command line options be like ? Thank you in advanced. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 15 replies
-
I would try
and see how well it does? OIIO supports iff, but it's so infrequently encountered that I don't want to speculate too confidently about whether absolutely everything iff can do is handled correctly. |
Beta Was this translation helpful? Give feedback.
-
@lgritz sent. Thank you in advanced. |
Beta Was this translation helpful? Give feedback.
-
I took a look at this, and it looks like our IFF reader ignores the Z channel of an RGBAZ image, once it sees RGBA it doesn't consider z. Thus, the sample file you sent me identifies as just RGBA, despite having the bit set in the header that indicates that it has a Z channel, too. It looks like our reader will recognize an IFF file that was Z only... but I'm not confident that it would decode the pixels correctly, and I don't have a Z-only iff file to test that hypothesis. I had hoped that maybe it would be a quick fix to get RGBAZ working, but now I'm convinced that it would actually be a substantial amount of work. While I'd happily accept a PR if somebody wanted to take this responsibility on, I can't justify doing it myself or officially putting it on the roadmap, for a format that is so rarely used. (As a data point: we've had the IFF reader for 14 years, and I think this is the first time anybody has noticed that it doesn't read depth channels. So the need must be fairly rare.) Sorry about that. |
Beta Was this translation helpful? Give feedback.
-
@mikaelsundell was the original author of the IFF file support, tagging him in case he has any comments. There is truly no pressure to fix this, Mikael, but I wouldn't want to deny you the chance if this omission has been causing you to lose sleep for the last 14 years and the only reason you haven't picked it up again is because you thought nobody would use or appreciate it. :-) |
Beta Was this translation helpful? Give feedback.
-
Quick update, I've made some changes:
The image specification is now up to date. I still need to do some additional work on the ZBUF channel. I'll start a PR once I have a basic version up and running. main...mikaelsundell:oiio:ms-IFF-250303 It's a bit of reverse engineering with this format, but I’m hoping for the best and will provide an update shortly. |
Beta Was this translation helpful? Give feedback.
-
@nyue @lgritz Ok, here we go: I've now added a more solid implementation of z-buffers in IFF, we can now both input and output such files with RLE/ per channel encoding in native float. Validated a set of output files - both 8/16-bit and Z-buffer in FCheck, looks correct. Over the next couple of days I will ask some friends to do some additional tests. The new updated IFF format works in Nuke and FCheck. At least FCheck uses the standard Maya libraries so it should be a good benchmark. All values are preserved in the depth map as discussed with Larry, to visualise such values you could do something like, (-1/z)/max in an Expression node in Nuke. The FCheck viewer uses something similar + compression of values to preset a nice visualisation in 0-1 range, so don't be surprised when testing IFF files outside FCheck. I will add some more documentation and probably run into some CI issues I will fix, once complete it's ready for a PR! |
Beta Was this translation helpful? Give feedback.
-
I'm marking this as closed, since the fix has been implemented and merged. |
Beta Was this translation helpful? Give feedback.
@nyue @lgritz Ok, here we go:
https://github.com/mikaelsundell/oiio/tree/ms-IFF-250303
I've now added a more solid implementation of z-buffers in IFF, we can now both input and output such files with RLE/ per channel encoding in native float. Validated a set of output files - both 8/16-bit and Z-buffer in FCheck, looks correct. Over the next couple of days I will ask some friends to do some additional tests. The new updated IFF format works in Nuke and FCheck. At least FCheck uses the standard Maya libraries so it should be a good benchmark.
All values are preserved in the depth map as discussed with Larry, to visualise such values you could do something like, (-1/z)/max in an Expression …