--render-format EXR saves as multi-layer EXR #54311

Closed
opened 2018-03-13 18:41:41 +01:00 by Sybren A. Stüvel · 5 comments

Commit 2a097527f2 changed the way EXR files are written, in a way that breaks loading & inspecting their size in Python.

To reproduce:

  • Get this blend file exr_save.blend
  • Render it with blender -b exr_save.blend --render-format EXR -o 'demo-###.exr' --render-anim
  • Open exr_save.blend regularly (so no background render) and run this script from the text editor:
import bpy

i = bpy.data.images.load("//demo-001.exr")

print(50 * '=')
print('Image type (1): %s' % i.type)
print('Image file format: %s' % i.file_format)
print('Image size: %dx%d' % tuple(i.size))
print('Image type (2): %s' % i.type)

2a097527f2 outputs:

Image type (1): IMAGE
Image file format: TARGA
Image size: 0x0
Image type (2): MULTILAYER

As you can see, the image is recognised as MULTILAYER, even though I specified --render-format EXR and not --render-format MULTILAYER.

Now build the preceeding revision ed72600 and follow these steps again (render in background, and run the script). It outputs:

Image type (1): IMAGE
Image file format: OPEN_EXR
Image size: 960x540
Image type (2): IMAGE

Here you see that we can actually get the file format we need.

Some background info: in Flamenco we use progressive rendering (e.g. rendering in Cycles sample chunks), which saves the chunks to EXR files and uses a blend file with a node tree to merge the samples. This blend file needs to be set up with the correct render resolution, which is taken from the EXR file. However, since this commit, we cannot do this as Blender doesn't report the image size for multilayer EXR files (#53768).

Commit 2a097527f20d changed the way EXR files are written, in a way that breaks loading & inspecting their size in Python. To reproduce: - Get this blend file [exr_save.blend](https://archive.blender.org/developer/F2440205/exr_save.blend) - Render it with `blender -b exr_save.blend --render-format EXR -o 'demo-###.exr' --render-anim` - Open `exr_save.blend` regularly (so no background render) and run this script from the text editor: ``` import bpy i = bpy.data.images.load("//demo-001.exr") print(50 * '=') print('Image type (1): %s' % i.type) print('Image file format: %s' % i.file_format) print('Image size: %dx%d' % tuple(i.size)) print('Image type (2): %s' % i.type) ``` 2a097527f20d outputs: ``` Image type (1): IMAGE Image file format: TARGA Image size: 0x0 Image type (2): MULTILAYER ``` As you can see, the image is recognised as `MULTILAYER`, even though I specified `--render-format EXR` and **not** `--render-format MULTILAYER`. Now build the preceeding revision ed72600 and follow these steps again (render in background, and run the script). It outputs: ``` Image type (1): IMAGE Image file format: OPEN_EXR Image size: 960x540 Image type (2): IMAGE ``` Here you see that we can actually get the file format we need. Some background info: in Flamenco we use progressive rendering (e.g. rendering in Cycles sample chunks), which saves the chunks to EXR files and uses a blend file with a node tree to merge the samples. This blend file needs to be set up with the correct render resolution, which is taken from the EXR file. However, since this commit, we cannot do this as Blender doesn't report the image size for multilayer EXR files (#53768).
Author
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Author
Member

Added subscribers: @brecht, @dfelinto

Added subscribers: @brecht, @dfelinto

Probably a duplicate of #54269, which revision did you test?

Probably a duplicate of #54269, which revision did you test?
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sybren A. Stüvel self-assigned this 2018-03-13 19:02:43 +01:00
Author
Member

Resolved in 50dde3d01a

Resolved in 50dde3d01a
Sign in to join this conversation.
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#54311
No description provided.