image datablocks fail to import multilayer exr layers that have a dot in the name. #89991
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#89991
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92
Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-07-16 19:29, hash:
118803893e
Worked: (newest version of Blender that worked as expected)
Exact steps for others to reproduce the error
open this file in the Blender image editor or an image node in the compositor:
The multilayer EXR contains the following layers as shown in Affinity:
when opening the file in Blender, all EXR layers that contain a dot in the name fail, as shown below. The image node is missing one of the EXR layers:
Added subscriber: @3di
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm.
#71574 (OpenEXR layers from View Layers with names containing a period can't be read by Nuke) is related (if not a duplicate)
Probably not a duplicate, I guess that indicates Nuke also has the same bug....maybe they're both using the same function of the openexr library to import, whereas Affinity isn't?
Hm, here is a similar file that actually seems to work:
Rendered from:
#71574.blend
hmm, in your file it doesn't show an output per layer, instead it changes the outputs based on the chosen layer. The functionality that my addon relies on, is to show all layers as outputs, otherwise it'll break a couple of months worth of programming.
i'm outputting the file from the compositor file output node by the way, whereas you're outputting it from a render animation.
Added subscribers: @Jeroen-Bakker, @brecht
Problem seems to be the assumption in
imb_exr_split_channel_name
/imb_exr_split_token
that the whole name contains three tokens:see https://developer.blender.org/diffusion/B/browse/master/source/blender/imbuf/intern/openexr/openexr_api.cpp$1418
In your case, there is only a
channel
andpass
, but nolayer
detected.If that is the case,
imb_exr_begin_read_mem
will create a layer viaimb_exr_get_layer
(should this be calledimb_exr_layer_ensure
then?) -- and somewhere this seems to go wrongUnsure how this should work:
pass
andlayer
be the same?pass
(e.g. "Combined") in this case?layer
andchannels
be permitted (without apass
)?CC @Jeroen-Bakker
CC @brecht
very strange:
Here's with all inputs not having dots. No option to choose a layer in the image node, they just all appear as outputs (which is imperative):
But if I change one of the inputs to have dots, then I get an option to choose layers, but only a single layer exists, and the letter after the final dot is taken to be the output...
I think maybe someone has gotten confused when adding multilayer to the file output node, and have taken inputs and layers to be the same thing. The correct functionality is to be able to specify the same layer for multiple inputs....although I'm not sure that explains the dot problem
This comment was removed by @3di
This comment was removed by @3di
OK, I found the problem. It's the file output node not adding any layer to the name:
it should be:
Layer . Name. File_format
so it's working when rendered from ctrl f12, because the output is:
name.with.dots.Combined.RGB
whereas the file output node is outputting:
name.with.dots.RGB (missing the layer)
so if the file output node isn't going to let the user specify a layer to assign the inputs to, then it should just add a layer name that doesn't contain any dots to the start of the string.
Changed status from 'Confirmed' to: 'Needs Developer To Reproduce'
either that, or one of these (permitting
layer.channel
- this is according to spec - and enforcinglayer.pass.channel
when reading -- or permitlayer.channel
as well which might be a bigger change since assumption atm islayer.pass.channel
):At this point, I think it would be good to get input from module devs.
yes, it should definitely follow the same convention as the rest of blender:
layer.pass.channel
as oppose to the current :
pass.channel
I can just manually add something without dots to the beginning of the input name for now. Would be great to have the file output node do that automatically though.
nope, still breaks if the pass has dots in it because the function that creates the image blocks when opening EXR's is searching from the right of the string, splitting it to get the channel, then searching from the right again and splitting it to get the pass, and then one more time to get the layer.
In order for it to work if the pass contains dots, the code that opens multilayer exr's it needs to do this instead:
x = full_layer_name
channel = x[ rfind('.') : ]
layer = x[ : x.find('.') ]
pass = x[ x.find('.') : x.rfind('.') ]
First, I would recommend to not use dots in the names at all, as they are the standard separator for EXR and it will inevitably lead to problems in Blender or other software. On top of that, while the EXR specification mentions dots, a lot of other software deviates from that and uses underscores instead. So I would use neither.
For reading, the best Blender can do is tweak heuristics to get a better result in undefined cases. For writing, we could show a warning and/or replace the dots when writing EXR files to sidestep the problem.
When only two tokens are provided when reading an EXR file, they are
pass
andchannel
. These should not be interpreted aslayer
.Would it be possible to keep everything as it is, but just use the code I posted above, then it won't matter if there are dots in the pass name, and it'll continue to work under all circumstances it currently works for. In the case of there being only two tokens, then you could just have:
if pass == channel:
I'm basically saving out AOV's via a file output node. If the user duplicates an AOV and doesn't realise Blender's auto renaming convention of adding .### after a duplicate AOV name, then Blender won't be able to re-open the saved EXRs.
Alternatively, the auto duplicate renaming could use _### instead of .###
other software doesn't matter, the files generated will only ever be used by Blender.
although the above alternative method I posted of getting the tokens from the string would also enable a user to import from other softwares that have dots in the pass name.
it would break again if the view layer has dots in it. Maybe the safest option is to enforce no dots in the aov and view layer names. Can't believe exr stores variables in the string, I thought it would use something like exr or json.
The current heuristic works well for Blender in many cases because the standard channel and pass names do not contain dots. The view layer name on the other hand is more likely to have dots, and is parsed correctly if you go from right to left. So I think that's pretty reasonable.
Avoiding automatic dots and warning against manually added dots in AOV names in Blender seems like a practical thing we can do.
This issue was referenced by
8e8932c8ff
Changed status from 'Needs Developer To Reproduce' to: 'Resolved'