Render Result showing the wrong renderlayer in image editor #53971

Closed
opened 2018-02-01 08:09:25 +01:00 by Mike Pan · 11 comments

Blender Version
Broken: 2.79 official, also tested on latest master.

Short description of error
When rendering with 'Only render active layer' enabled in the renderlayer panel, the image editor switches to a seemingly random renderlayer when rendering is finished, instead of showing the active renderlayer.

Exact steps for others to reproduce the error

  1. Open Blend file attached and hit F12
  2. Select another render and render again.
  3. Repeat #2 a few times and notice that the image editor starts to show you a random renderlayer in the stack, instead of the one you are rendering.

renderlayer.blend

**Blender Version** Broken: 2.79 official, also tested on latest master. **Short description of error** When rendering with 'Only render active layer' enabled in the renderlayer panel, the image editor switches to a seemingly random renderlayer when rendering is finished, instead of showing the active renderlayer. **Exact steps for others to reproduce the error** 1. Open Blend file attached and hit F12 2. Select another render and render again. 3. Repeat #2 a few times and notice that the image editor starts to show you a random renderlayer in the stack, instead of the one you are rendering. [renderlayer.blend](https://archive.blender.org/developer/F2068499/renderlayer.blend)
Author

Added subscriber: @MikePan

Added subscriber: @MikePan

Added subscriber: @zeauro

Added subscriber: @zeauro

confirmed on 2.79 and master under ubuntu 16.04

Problem seems to occur for both render engines BI and Cycles.

confirmed on 2.79 and master under ubuntu 16.04 Problem seems to occur for both render engines BI and Cycles.

Added subscriber: @oweissbarth

Added subscriber: @oweissbarth

Added subscriber: @chnchryl

Added subscriber: @chnchryl

Hi there, I'm new to this, but I've been poking around with this bug to find my way around. From what I gather, the displayed render-layer is affected by the value of ‘iuser->layer’ in ‘uiblock_layer_pass_buttons’, which displays the rendered layer corresponding to the index of ‘iuser->layer’. It's set to 1 initially, so when multiple layers are rendered consecutively, it keeps displaying the second layer in the rendered stack. (If there isn't a layer at that index, it'll just display the closest one.) If you select a different layer to be displayed in the image editor, ‘iuser->layer’ is properly updated to that layer's index, and then it'll keep displaying the render layer at that index until you set another layer.

I think the issue is that ‘iuser->layer’ is only directly affected by the selected layer in the image editor, but not the layer that is being rendered. A possible fix could be to update ‘iuser->layer’ to the selected render layer, particularly when ‘Only render active layer' is enabled? Or maybe have the displayed layer be directly affected by the layer that was last rendered…Anyway, I’ll poke around a bit more and see if I can find a work-around.

Hi there, I'm new to this, but I've been poking around with this bug to find my way around. From what I gather, the displayed render-layer is affected by the value of ‘iuser->layer’ in ‘uiblock_layer_pass_buttons’, which displays the rendered layer corresponding to the index of ‘iuser->layer’. It's set to 1 initially, so when multiple layers are rendered consecutively, it keeps displaying the second layer in the rendered stack. (If there isn't a layer at that index, it'll just display the closest one.) If you select a different layer to be displayed in the image editor, ‘iuser->layer’ is properly updated to that layer's index, and then it'll keep displaying the render layer at that index until you set another layer. I think the issue is that ‘iuser->layer’ is only directly affected by the selected layer in the image editor, but not the layer that is being rendered. A possible fix could be to update ‘iuser->layer’ to the selected render layer, particularly when ‘Only render active layer' is enabled? Or maybe have the displayed layer be directly affected by the layer that was last rendered…Anyway, I’ll poke around a bit more and see if I can find a work-around.

Added subscriber: @brecht

Added subscriber: @brecht

A possible fix could be to update ‘iuser->layer’ to the selected render layer, particularly when ‘Only render active layer' is enabled?

Yes, I think iuser->layer should be automatically set to the active render layer when "Only render active layer" is enabled. This means changing render_image_restore_layer() behavior.

> A possible fix could be to update ‘iuser->layer’ to the selected render layer, particularly when ‘Only render active layer' is enabled? Yes, I think `iuser->layer` should be automatically set to the active render layer when "Only render active layer" is enabled. This means changing `render_image_restore_layer()` behavior.

Yes, I think iuser->layer should be automatically set to the active render layer when "Only render active layer" is enabled. This means changing render_image_restore_layer() behavior.

Thanks for the tip! I've got a working implementation now, but I'm not sure if it's the most efficient. I couldn't use render_get_active_layer(), since it seemed to be using the layer index corresponding to the full layer list on the list of only the rendered layers, which seems a bit strange? So it sometimes returns the wrong layer if not all layers are rendered yet. Right now, I'm getting the layer name from the list of all render layers, and then using that to find the string index in the rendered layer list, but that requires looping through both lists...
I'm also not sure how to check whether "Only render active layer" is used or not. I'm looking at RenderSettings_use_single_layer_get(), but it takes in a PointerRNA. Is there anything in RenderJob that holds that pointer? Thanks!

>Yes, I think iuser->layer should be automatically set to the active render layer when "Only render active layer" is enabled. This means changing render_image_restore_layer() behavior. Thanks for the tip! I've got a working implementation now, but I'm not sure if it's the most efficient. I couldn't use render_get_active_layer(), since it seemed to be using the layer index corresponding to the full layer list on the list of only the rendered layers, which seems a bit strange? So it sometimes returns the wrong layer if not all layers are rendered yet. Right now, I'm getting the layer name from the list of all render layers, and then using that to find the string index in the rendered layer list, but that requires looping through both lists... I'm also not sure how to check whether "Only render active layer" is used or not. I'm looking at RenderSettings_use_single_layer_get(), but it takes in a PointerRNA. Is there anything in RenderJob that holds that pointer? Thanks!

This issue was referenced by 07b07e53ea

This issue was referenced by 07b07e53ea0831ffb0c2a3aff0a33b40aa935c5c

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
6 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#53971
No description provided.