insert_keyframe and bpy.ops from bpy.app.timers, now causes Blender to crash #64228

Closed
opened 2019-05-07 04:03:12 +02:00 by Ovionis · 5 comments

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 770/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.35

Blender Version
Broken: version: 2.80 (sub 60), branch: master, commit date: 2019-05-06 16:39, hash: c0432c2385
Worked: version: 2.80 (sub 59), branch: master, commit date: 2019-04-26 06:00, hash: 513b71c89a

Short description of error
When running a function inside a bpy.apps.timers loop (The first function run does not crash),
using keyframe_insert() on an object/bone/etc or running an operator from bpy.ops,
causes Blender to crash.

Exact steps for others to reproduce the error
Click Run Script.

!Timed Crash.blend

(The window on the left is the latest working version I have. I overwrote my newer "working" build from May 1st, trying to get colored icons)
2019-05-06 20-49-55.mp4


My script runs a modal operator, that performs separate functions in bpy.app.timers, because 2.8's modal does not run indefinitely,
requiring the user to do "SOMETHING" like moving the mouse, whereas I want the operator to run in the background until it's done or cancelled.
At first I found this crash when calling keyframe_insert()
but as part of the unrelated question I wanted to ask below, I found that when calling operators, they now crash instead of just returning an error.
(At least the ones I'm trying to use, which clear the pose or transforms)

unrelated:
Attributes inside bpy.context are not available from timers, meaning context has to be duplicated outside of it.
Is there an alternative? Because I have to opt to creating a global variable like:
Global.context = type('context', (), bpy.context.copy())

**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: GeForce GTX 770/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.35 **Blender Version** Broken: version: 2.80 (sub 60), branch: master, commit date: 2019-05-06 16:39, hash: `c0432c2385` Worked: version: 2.80 (sub 59), branch: master, commit date: 2019-04-26 06:00, hash: `513b71c89a` **Short description of error** When running a function inside a `bpy.apps.timers` loop *(The first function run does not crash)*, using `keyframe_insert()` on an object/bone/etc or running an operator from `bpy.ops`, causes Blender to crash. **Exact steps for others to reproduce the error** Click Run Script. [!Timed Crash.blend](https://archive.blender.org/developer/F7011247/_Timed_Crash.blend) *(The window on the left is the latest working version I have. I overwrote my newer "working" build from May 1st, trying to get colored icons)* [2019-05-06 20-49-55.mp4](https://archive.blender.org/developer/F7011248/2019-05-06_20-49-55.mp4) - - - - - My script runs a modal operator, that performs separate functions in `bpy.app.timers`, because 2.8's modal does not run indefinitely, requiring the user to do **"SOMETHING"** like moving the mouse, whereas I want the operator to run in the background until it's done or cancelled. At first I found this crash when calling `keyframe_insert()` but as part of the ***unrelated** question* I wanted to ask below, I found that when calling operators, they now crash instead of just returning an error. *(At least the ones I'm trying to use, which clear the pose or transforms)* ***unrelated:*** Attributes inside `bpy.context` are not available from timers, meaning context has to be duplicated outside of it. Is there an alternative? Because I have to opt to creating a global variable like: `Global.context = type('context', (), bpy.context.copy())`
Author

Added subscriber: @Phigon

Added subscriber: @Phigon

Added subscriber: @ZedDB

Added subscriber: @ZedDB
Sergey Sharybin was assigned by Sebastian Parborg 2019-05-07 12:50:50 +02:00

Seems like the depsgraph sound commit broke this: 2e582f8ab5 (bisected)

Seems like the depsgraph sound commit broke this: 2e582f8ab5 (bisected)

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

The buggy code has been temporarily reverted in 2b9965122e. Will keep this report in mind during re-iteration over the fix.

Thanks for the report, closing now.

The buggy code has been temporarily reverted in 2b9965122e. Will keep this report in mind during re-iteration over the fix. Thanks for the report, closing now.
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
3 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#64228
No description provided.