frame change handlers stop getting triggered after rendering more than 3 to 5 times. #90032

Closed
opened 2021-07-22 00:58:48 +02:00 by michael campbell · 11 comments

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.2 Release Candidate, branch: master, commit date: 2021-07-07 05:52, hash: 9e64fd461a
Worked: (newest version of Blender that worked as expected)

Exact steps for others to reproduce the error
open file and follow instructions in the script editor:

frame change handler only works intermittently when called from code.blend
image.png

**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.2 Release Candidate, branch: master, commit date: 2021-07-07 05:52, hash: `9e64fd461a` Worked: (newest version of Blender that worked as expected) **Exact steps for others to reproduce the error** open file and follow instructions in the script editor: [frame change handler only works intermittently when called from code.blend](https://archive.blender.org/developer/F10232664/frame_change_handler_only_works_intermittently_when_called_from_code.blend) ![image.png](https://archive.blender.org/developer/F10232661/image.png)

Added subscriber: @3di

Added subscriber: @3di
Member

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

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

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123

This comment was removed by @3di

*This comment was removed by @3di*

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Testing in 2.93 release & master, the second render is always raising an exception:

KeyError: 'bpy_struct[key]: key "file_out_keep" not found'

The second execution sets the the frame, this runs the frame-change handler twice, the second time it runs it can't access the key.


@3di can you confirm if this is the behavior you see too?

Testing in 2.93 release & master, the second render is always raising an exception: `KeyError: 'bpy_struct[key]: key "file_out_keep" not found'` The second execution sets the the frame, this runs the frame-change handler twice, the second time it runs it can't access the key. ---- @3di can you confirm if this is the behavior you see too?

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

you shouldn't be getting that, that's a remnant of an old addon. Delete the 'file_out_keep' scene property to resolve that.

you shouldn't be getting that, that's a remnant of an old addon. Delete the 'file_out_keep' scene property to resolve that.

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Tested again with 2.93 release and I'm not getting this anymore.

Tested again with 2.93 release and I'm not getting this anymore.

I've looked into the Python code and to me it seems it relies on a specific order and way which and in which order the handlers are run.

The frame-change handler might run prior to render, and it might not be run after the render. This makes the state machine of using finished rendering very fragile.

What happens now is that at the end of the first render finished rendering is created and then the update_on_frame_change is called. Next time you render, the render pipeline calls the frame change handler, which "sees" that the finished rendering property exists and will do things which I believe intention is to only do at the end of the render. Note that the update_on_frame_change is also called after pre_render_job during the first render, so there is no descrepency in the which handlers are called.

I've tried ti simplify the code to make it more visible, hopefully without affecting the overall state machine.

I believe there are more straightforward and robust ways of achieving your goals, but looking into those is outside of a bug fixing process. You are welcome to join and ask for advices in the #python room on the blender.chat.

I've looked into the Python code and to me it seems it relies on a specific order and way which and in which order the handlers are run. The frame-change handler might run prior to render, and it might not be run after the render. This makes the state machine of using `finished rendering` very fragile. What happens now is that at the end of the first render `finished rendering` is created and then the `update_on_frame_change` is called. Next time you render, the render pipeline calls the frame change handler, which "sees" that the `finished rendering` property exists and will do things which I believe intention is to only do at the end of the render. Note that the `update_on_frame_change` is also called after `pre_render_job` during the first render, so there is no descrepency in the which handlers are called. I've tried ti simplify the code to make it more visible, hopefully without affecting the overall state machine. I believe there are more straightforward and robust ways of achieving your goals, but looking into those is outside of a bug fixing process. You are welcome to join and ask for advices in the `#python` room on the blender.chat.
Blender Bot added
Status
Archived
and removed
Status
Needs Info from Developers
labels 2023-02-15 11:15:30 +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
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#90032
No description provided.