Blender freezes when trying to render from python script with turned on eevee motion blur. #80373

Closed
opened 2020-09-02 12:20:07 +02:00 by Sham · 6 comments

System Information
Operating system: Windows 10
Graphics card: GTX 1080

Blender Version
Broken: 2.90 and 2.91 alpha
Worked: None

Short description of error
Blender freezes when trying to render a frame with motion blur enabled in eevee renderer.

Exact steps for others to reproduce the error

  • Create a simple cube and apply a rotating animation on it.
  • Go to render settings tab, switch to eevee renderer and enable motion blur (you can keep the default values).

Switch to scripting layout and write the following script:

import bpy

scene = bpy.context.scene

scene.render.image_settings.file_format = 'PNG'
scene.render.filepath = "C:/tmp/image.png"

bpy.ops.render.render(write_still = 1)

Try to run the script and you will find that Blender is freezing.

note: if you turned off motion blur it will render just fine. the problem is when you enable the motion blur.

Used blender file
basic_scene_01.blend

**System Information** Operating system: Windows 10 Graphics card: GTX 1080 **Blender Version** Broken: 2.90 and 2.91 alpha Worked: None **Short description of error** Blender freezes when trying to render a frame with motion blur enabled in eevee renderer. **Exact steps for others to reproduce the error** - Create a simple cube and apply a rotating animation on it. - Go to render settings tab, switch to eevee renderer and enable motion blur (you can keep the default values). # Switch to scripting layout and write the following script: ``` import bpy scene = bpy.context.scene scene.render.image_settings.file_format = 'PNG' scene.render.filepath = "C:/tmp/image.png" bpy.ops.render.render(write_still = 1) ``` Try to run the script and you will find that Blender is freezing. > note: if you turned off motion blur it will render just fine. the problem is when you enable the motion blur. **Used blender file** [basic_scene_01.blend](https://archive.blender.org/developer/F8832259/basic_scene_01.blend)
Author

Added subscriber: @VFX-Kitchen

Added subscriber: @VFX-Kitchen
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

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]	
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] ```
Member

Closed as duplicate of #79889

Closed as duplicate of #79889
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
4 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#80373
No description provided.