python render.render() calls frame change handler even if it's rendering a single frame. Leads to recursion and crash if handler executed render.render() in the first place. #88726
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#88726
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: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92
Blender Version
Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-04-29 17:14, hash:
39226cd437
Worked: (newest version of Blender that worked as expected)
Short description of error
[Please fill out a short description of the error here]
Exact steps for others to reproduce the error
Immediate crash of blender with any addon that calls render.render() from a frame change handler. It only happens when changing the playhead position in the timeline using the mouse, not when manually entering a frame number, or when using the left right arrows. So the problem appears to be that when blender/blender-addons#60094 was closed, the resolution didn't account for changing the frame with the mouse in the timeline.
Here's a simple script to test with. Open in the blender text editor, click run, and then change the frame by clicking an area of the timeline so that the playhead jumps to that frame.
newbug.txt
error:
Error : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF6317BAB2D
Module : blender.exe
Thread : 000026fc
Writing: C:\Users\3diWorkstation\AppData\Local\Temp\simple.crash.txt
simple.crash.txt
video:
2021-06-01 16-55-49.mp4
Added subscriber: @3di
desgraph fix T60094 doesn't work when using the timeline playhead. Instant crash with access violation.to immediate crash when moving the playhead with the mouse if frame change handler calls render.render()Added subscriber: @brecht
Calling
bpy.ops.render.render()
from a frame change handler is problematic because that in turn might cause the frame change handler to be called. I don't know if that is supported at all, maybe there is a way to get it working or at least fail with an error message without crashing.blender/blender-addons#60094 also involves a frame change handler but otherwise seems unrelated.
@brecht I've just tested that by using a scene property to ensure the handler is only hit once, and it still crashes. I think if that had been the case, then it would crash when changing the frame using the timeline's current frame textbox, and when using the left and right arrows to change the frame, as they all call the same handler.
It seems changing the frame using the playhead or clicking a spot on the timeline for the playhead to jump to, doesn't update the desgraph in the same way the other methods of updating the frame do?
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can at least confirm it crashes
I think my problem was actually not due to the recursion, because I'd overcome that using scene properties to limit it to one execution per call, but my problem turned out to be calling an operator from within the frame handler. My operator basically re-rendered the frame when the frame was changed.
So the bug for this report should probably be that when initiating a render from python using render.render(), a frame change handler is executed even if the frame is identical. f12 doesn't have the same problem.
should I make a separate bug report about calling operators from frame handler causes access violation?
I've made a new report specific to the timeline bug in relation to frame change handlers:
https://developer.blender.org/T88739
immediate crash when moving the playhead with the mouse if frame change handler calls render.render()to python render.render() calls frame change handler even if it's rendering a single frame.python render.render() calls frame change handler even if it's rendering a single frame.to python render.render() calls frame change handler even if it's rendering a single frame. Leads to recursion and crash.python render.render() calls frame change handler even if it's rendering a single frame. Leads to recursion and crash.to python render.render() calls frame change handler even if it's rendering a single frame. Leads to recursion and crash if handler executed render.render() in the first place.