"RENDER_OT_render" called with "EXEC_DEFAULT" freezes Blender with Eevee motion blur enabled #79889

Open
opened 2020-08-18 17:57:19 +02:00 by Andrey Sokolov · 14 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 451.67

Blender Version
Broken: version: 2.90.0 Beta, branch: master, commit date: 2020-08-17 19:04, hash: e157573fab
Worked: (newest version of Blender that worked as expected)

Short description of error
bpy.ops.render.render() called without 'INVOKE_DEFAULT' from the Python Console or script freezes Blender when Eevee motion blur is enabled.
And the same issue is in the 2.91 Alpha version.


Exact steps for others to reproduce the error

  • Open Blender
  • Make sure context scene render engine is Eevee
  • Turn on motion blur
  • Open Python console
  • type in bpy.ops.render.render() and hit enter

Edit (added method that doesn't activate via Python).

Exact steps to reproduce the error without activating from Python.

  • Open Blender
  • Make sure context scene render engine is Eevee
  • Turn on motion blur
  • Run this script in the text editor
import bpy
def menu_func_import(self, context):
    layout = self.layout
    layout.operator_context = 'EXEC_DEFAULT'
    layout.operator("render.render", text="Blocking Render")
bpy.types.TOPBAR_MT_render.append(menu_func_import)
  • Run "Render -> Blocking Render" from the top-bar.
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 451.67 **Blender Version** Broken: version: 2.90.0 Beta, branch: master, commit date: 2020-08-17 19:04, hash: `e157573fab` Worked: (newest version of Blender that worked as expected) **Short description of error** bpy.ops.render.render() called without 'INVOKE_DEFAULT' from the Python Console or script freezes Blender when Eevee motion blur is enabled. And the same issue is in the 2.91 Alpha version. ---- **Exact steps for others to reproduce the error** - Open Blender - Make sure context scene render engine is Eevee - Turn on motion blur - Open Python console - type in bpy.ops.render.render() and hit enter ---- *Edit* (added method that doesn't activate via Python). **Exact steps to reproduce the error without activating from Python.** - Open Blender - Make sure context scene render engine is Eevee - Turn on motion blur - Run this script in the text editor ``` import bpy def menu_func_import(self, context): layout = self.layout layout.operator_context = 'EXEC_DEFAULT' layout.operator("render.render", text="Blocking Render") bpy.types.TOPBAR_MT_render.append(menu_func_import) ``` - Run "Render -> Blocking Render" from the top-bar.
Author

Added subscriber: @Andrey_Sokolov

Added subscriber: @Andrey_Sokolov

#80373 was marked as duplicate of this issue

#80373 was marked as duplicate of this issue
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Possibly related: #79891 (Using python handlers introduces artifacts with EEVEE motion blur)

Possibly related: #79891 (Using python handlers introduces artifacts with EEVEE motion blur)

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can reproduce this. The 2.83.4 release is unaffected though.

I can reproduce this. The 2.83.4 release is unaffected though.
Member

Added subscribers: @VFX-Kitchen, @mano-wii, @Raimund58

Added subscribers: @VFX-Kitchen, @mano-wii, @Raimund58
Member

Tagging this as a bug as @mano-wii did for #80373.

Quoting Germano’s commit from that report as it contains a stack trace.

In #80373#1008466, @mano-wii wrote:
I can confirm.
The problem is "solved" if I add an "INVOKE_DEFAULT" to the operator.

 	[External Code]	
>	blender.exe!BLI_ticket_mutex_lock(TicketMutex * ticket) Line 584	C++

blender.exe!DRW_notify_view_update(const DRWUpdateContext * update_ctx) Line 1240 C
blender.exe!ED_render_scene_update(const DEGEditorUpdateContext * update_ctx, int updated) Line 119 C
blender.exe!DEG_ids_check_recalc(Main * bmain, Depsgraph * depsgraph, Scene * scene, ViewLayer * view_layer, bool time) Line 830 C++
blender.exe!BKE_scene_graph_update_for_newframe(Depsgraph * depsgraph) Line 1598 C
blender.exe!RE_engine_frame_set(RenderEngine * engine, int frame, float subframe) Line 642 C
blender.exe!DRW_render_set_time(RenderEngine * engine, Depsgraph * depsgraph, int frame, float subframe) Line 1954 C
blender.exe!eevee_render_to_image(void * vedata, RenderEngine * engine, RenderLayer * render_layer, const rcti * rect) Line 484 C
blender.exe!DRW_render_to_image(RenderEngine * engine, Depsgraph * depsgraph) Line 1779 C
blender.exe!RE_engine_render(Render * re, int do_all) Line 880 C
blender.exe!do_render(Render * re) Line 1216 C
blender.exe!do_render_composite(Render * re) Line 1354 C
blender.exe!do_render_all_options(Render * re) Line 1616 C
blender.exe!RE_RenderFrame(Render * re, Main * bmain, Scene * scene, ViewLayer * single_layer, Object * camera_override, int frame, const bool write_still) Line 2015 C
blender.exe!screen_render_exec(bContext * C, wmOperator * op) Line 364 C
blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1312 C
blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1547 C
blender.exe!WM_operator_call_py(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties, ReportList * reports, const bool is_undo) Line 1644 C
blender.exe!pyop_call(_object * UNUSED_self, _object * args) Line 279 C
python37.dll!_PyMethodDef_RawFastCallKeywords(PyMethodDef * method, _object * self, _object * const * args, __int64 nargs, _object * kwnames) Line 698 C
[Inline Frame] python37.dll!_PyCFunction_FastCallKeywords(_object *) Line 734 C
python37.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4568 C
python37.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3125 C
[Inline Frame] python37.dll!PyEval_EvalFrameEx(_frame *) Line 547 C
python37.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * const * args, __int64 argcount, _object * const * kwnames, _object * const * kwargs, __int64 kwcount, int kwstep, _object * const * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 3930 C
python37.dll!_PyFunction_FastCallDict(_object * func, _object * const * args, __int64 nargs, _object * kwargs) Line 376 C
python37.dll!_PyObject_Call_Prepend(_object * callable, _object * obj, _object * args, _object * kwargs) Line 908 C
python37.dll!slot_tp_call(_object * self, _object * args, _object * kwds) Line 6403 C
python37.dll!_PyObject_FastCallKeywords(_object * callable, _object * const * stack, __int64 nargs, _object * kwnames) Line 201 C
python37.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4627 C
python37.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3140 C
[Inline Frame] python37.dll!PyEval_EvalFrameEx(_frame *) Line 547 C
python37.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * const * args, __int64 argcount, _object * const * kwnames, _object * const * kwargs, __int64 kwcount, int kwstep, _object * const * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 3930 C
[Inline Frame] python37.dll!PyEval_EvalCodeEx(_object *) Line 3959 C
python37.dll!PyEval_EvalCode(_object * co, _object * globals, _object * locals) Line 530 C
blender.exe!python_script_exec(bContext * C, const unsigned char * fn, Text * text, ReportList * reports, const bool do_jump) Line 127 C
blender.exe!BPY_run_text(bContext * C, Text * text, ReportList * reports, const bool do_jump) Line 222 C
blender.exe!text_run_script(bContext * C, ReportList * reports) Line 760 C
blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1312 C
blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1516 C
blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1562 C
blender.exe!ui_apply_but_funcs_after(bContext * C) Line 925 C
blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10732 C
blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 641 C
blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2756 C
blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2868 C
blender.exe!wm_event_do_handlers(bContext * C) Line 3292 C
blender.exe!WM_main(bContext * C) Line 485 C
blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 531 C
[External Code]

Tagging this as a bug as @mano-wii did for #80373. Quoting Germano’s commit from that report as it contains a stack trace. > In #80373#1008466, @mano-wii wrote: > I can confirm. > The problem is "solved" if I add an `"INVOKE_DEFAULT"` to the operator. > ```lines > [External Code] >> blender.exe!BLI_ticket_mutex_lock(TicketMutex * ticket) Line 584 C++ > blender.exe!DRW_notify_view_update(const DRWUpdateContext * update_ctx) Line 1240 C > blender.exe!ED_render_scene_update(const DEGEditorUpdateContext * update_ctx, int updated) Line 119 C > blender.exe!DEG_ids_check_recalc(Main * bmain, Depsgraph * depsgraph, Scene * scene, ViewLayer * view_layer, bool time) Line 830 C++ > blender.exe!BKE_scene_graph_update_for_newframe(Depsgraph * depsgraph) Line 1598 C > blender.exe!RE_engine_frame_set(RenderEngine * engine, int frame, float subframe) Line 642 C > blender.exe!DRW_render_set_time(RenderEngine * engine, Depsgraph * depsgraph, int frame, float subframe) Line 1954 C > blender.exe!eevee_render_to_image(void * vedata, RenderEngine * engine, RenderLayer * render_layer, const rcti * rect) Line 484 C > blender.exe!DRW_render_to_image(RenderEngine * engine, Depsgraph * depsgraph) Line 1779 C > blender.exe!RE_engine_render(Render * re, int do_all) Line 880 C > blender.exe!do_render(Render * re) Line 1216 C > blender.exe!do_render_composite(Render * re) Line 1354 C > blender.exe!do_render_all_options(Render * re) Line 1616 C > blender.exe!RE_RenderFrame(Render * re, Main * bmain, Scene * scene, ViewLayer * single_layer, Object * camera_override, int frame, const bool write_still) Line 2015 C > blender.exe!screen_render_exec(bContext * C, wmOperator * op) Line 364 C > blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1312 C > blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1547 C > blender.exe!WM_operator_call_py(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties, ReportList * reports, const bool is_undo) Line 1644 C > blender.exe!pyop_call(_object * UNUSED_self, _object * args) Line 279 C > python37.dll!_PyMethodDef_RawFastCallKeywords(PyMethodDef * method, _object * self, _object * const * args, __int64 nargs, _object * kwnames) Line 698 C > [Inline Frame] python37.dll!_PyCFunction_FastCallKeywords(_object *) Line 734 C > python37.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4568 C > python37.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3125 C > [Inline Frame] python37.dll!PyEval_EvalFrameEx(_frame *) Line 547 C > python37.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * const * args, __int64 argcount, _object * const * kwnames, _object * const * kwargs, __int64 kwcount, int kwstep, _object * const * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 3930 C > python37.dll!_PyFunction_FastCallDict(_object * func, _object * const * args, __int64 nargs, _object * kwargs) Line 376 C > python37.dll!_PyObject_Call_Prepend(_object * callable, _object * obj, _object * args, _object * kwargs) Line 908 C > python37.dll!slot_tp_call(_object * self, _object * args, _object * kwds) Line 6403 C > python37.dll!_PyObject_FastCallKeywords(_object * callable, _object * const * stack, __int64 nargs, _object * kwnames) Line 201 C > python37.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4627 C > python37.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3140 C > [Inline Frame] python37.dll!PyEval_EvalFrameEx(_frame *) Line 547 C > python37.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * const * args, __int64 argcount, _object * const * kwnames, _object * const * kwargs, __int64 kwcount, int kwstep, _object * const * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 3930 C > [Inline Frame] python37.dll!PyEval_EvalCodeEx(_object *) Line 3959 C > python37.dll!PyEval_EvalCode(_object * co, _object * globals, _object * locals) Line 530 C > blender.exe!python_script_exec(bContext * C, const unsigned char * fn, Text * text, ReportList * reports, const bool do_jump) Line 127 C > blender.exe!BPY_run_text(bContext * C, Text * text, ReportList * reports, const bool do_jump) Line 222 C > blender.exe!text_run_script(bContext * C, ReportList * reports) Line 760 C > blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1312 C > blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1516 C > blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1562 C > blender.exe!ui_apply_but_funcs_after(bContext * C) Line 925 C > blender.exe!ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10732 C > blender.exe!wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 641 C > blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2756 C > blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2868 C > blender.exe!wm_event_do_handlers(bContext * C) Line 3292 C > blender.exe!WM_main(bContext * C) Line 485 C > blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 531 C > [External Code] > ```

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Confirmed, note that this isn't Python spesific, removed Python project.

Confirmed, note that this isn't Python spesific, removed Python project.
Campbell Barton changed title from bpy.ops.render.render() called from console or script freezes Blender with Eevee motion blur enabled to bpy.ops.render.render() called with "EXEC_DEFAULT" or script freezes Blender with Eevee motion blur enabled 2020-09-12 03:13:42 +02:00
Campbell Barton changed title from bpy.ops.render.render() called with "EXEC_DEFAULT" or script freezes Blender with Eevee motion blur enabled to "RENDER_OT_render" called with "EXEC_DEFAULT" or script freezes Blender with Eevee motion blur enabled 2020-09-12 03:14:16 +02:00
Campbell Barton changed title from "RENDER_OT_render" called with "EXEC_DEFAULT" or script freezes Blender with Eevee motion blur enabled to "RENDER_OT_render" called with "EXEC_DEFAULT" freezes Blender with Eevee motion blur enabled 2020-09-12 03:14:41 +02:00
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

There is a cyclic lock when the main thread does the rendering

Render -> Motionblur updates the depsgraph for other frame -> Depsgraph signals for view update -> Draw manager wants to lock gl_context in the main thread.

This happens in DRW_notify_view_update. The reason why there is a lock is that this function overwrites the DST to detect the engines of a view and make sure that the engine data is available in the viewport. Workbench and EEVEE only uses the engine data to set some flags.

A solution would be to add a function to add find all needed engines (we could add a ListBase parameter to current functions) and do the GPU update on the viewport itself and not via the DST. This will reduce the lock to viewport drw_viewport_engine_data_ensure and DRW_notify_view_update. The problem still with this solution is that material can still interfere with the update flags. Not sure how big of an issue this is. We could ignore scenes that don't have scenes. By checking if they are they should Can't we ignore material preview by checking if the original scene isn't a preview scene...

@fclem any suggestions?

There is a cyclic lock when the main thread does the rendering Render -> Motionblur updates the depsgraph for other frame -> Depsgraph signals for view update -> Draw manager wants to lock gl_context in the main thread. This happens in `DRW_notify_view_update`. The reason why there is a lock is that this function overwrites the DST to detect the engines of a view and make sure that the engine data is available in the viewport. Workbench and EEVEE only uses the engine data to set some flags. A solution would be to add a function to add find all needed engines (we could add a ListBase parameter to current functions) and do the GPU update on the viewport itself and not via the DST. This will reduce the lock to viewport `drw_viewport_engine_data_ensure` and `DRW_notify_view_update`. The problem still with this solution is that material can still interfere with the update flags. Not sure how big of an issue this is. We could ignore scenes that don't have scenes. By checking if they are they should Can't we ignore material preview by checking if the original scene isn't a preview scene... @fclem any suggestions?
Member

Added subscriber: @fclem

Added subscriber: @fclem
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:14:34 +01:00
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#79889
No description provided.