Viewer node pixels do not update when running blender in background-mode #91891
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#91891
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: Linux-5.11.0-37-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: Mesa Intel(R) UHD Graphics 630 (CFL GT2) Intel 4.6 (Core Profile) Mesa 21.0.3
Blender Version
Broken: version: 2.93.4, branch: master, commit date: 2021-08-31 09:23, hash:
b7205031ce
Worked: (newest version of Blender that worked as expected)
Short description of error
I am trying to render images using blender as a python module. I compiled blender as bpy.so module following the official guide at the following link:
https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule
The installation works fine if I save renders to file on the hard disk. What I want to do is access the rendered pixels before they are saved to file because I need to process the image within python. Saving the image to file and reloading it is not feasible due to performance issues. I have been able to use this workaround using the viewer node as described at this link, although only with the blender UI open:
https://ammous88.wordpress.com/2015/01/16/blender-access-render-results-pixels-directly-from-python-2/
When running it using blender compiled as a python module, this doesn't work. Specifically, the viewer node pixels don't seem to get updated (their value is always 0 and the resolution is always default and cannot be changed). I found a similar problem when running blender in the background as described here:
https://blender.stackexchange.com/questions/69230/python-render-script-different-outcome-when-run-in-background/81240#81240
I'm encountering the same issue when running blender as a python module. I tried following the steps at the previous link to rebuild blender and enable background viewer node update but the source code seems to have changed since the time of that post (the steps are shown in the picture below). Is this still possible? I think there is a lot of potential in this feature and it seems it can be activated by simply rebuilding the module from source. If that's the case, it would be nice to know how.
Thanks.
Exact steps for others to reproduce the error
The problem can be reproduced using the file provided (it is simply the default file). The bpy module has been built using the last available source code from the blender repository at the time of writing. The python code to reproduce the problem is:
the output of the code is:
note that the script correctly renders the scene but the output of the print() function returns 0.0 which means that the values in the "pixels" array are all 0.
Added subscriber: @Andrea-3
default.blend
this is the file used to reproduce the results.
Removed subscriber: @Andrea-3
Added subscriber: @Andrea-3
Added subscriber: @Gadgeteering
Changed status from 'Needs Triage' to: 'Confirmed'
I am having the same problem, it seems that the source code for a couple of the header files need to be updated to solve this issue.
Solution
Changed status from 'Confirmed' to: 'Needs Triage'
Added subscribers: @lichtwerk, @ideasman42, @mano-wii
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Blender as a python module is not something the #triaging team is used to checking.
I'm not sure if this is a feature tracked by this Bug Tracker (I didn't even find a tag for it).
@ideasman42, if I'm not mistaken, you're maintaining the module. How would you like these issues to be handled?
(@lichtwerk, I'm tagging you in case I'm missing something).
If we move this out of the triaging queue (by changing status label to
Needs Information from Developers
), this needs to be the responsibility of a module (so aModule
label must be added)@ideasman42 ^
This isn't related to running blender as a Python module, the same problem happens in background mode.
Save as
test_render.py
Run:
blender --factory-startup --python test_render.py
Now run:
blender --factory-startup --background --python test_render.py
When in background mode, the printed result is
0.0
Viewer node pixels do not update when running blender as python moduleto Viewer node pixels do not update when running blender in background-modeAs far as I know, Eevee already supports background rendering, so this must be a
Render Pipeline
issue.This is likely working as intended since using the viewer-node in background mode is unnecessary overhead in most cases (on render-farms for e.g.).
This could be supported but don't think it's a bug.
For why this is requested, see also #54314