tag_redraw() stops working in 2.8 after context change but works in 2.7? Problem of event_timer_add()? #61822

Closed
opened 2019-02-21 21:39:08 +01:00 by Brent Lio · 11 comments

https://developer.blender.org/T61764
As the above report mentioned,

I suspected that in 2.8, the redraw stopped because of the loss of context, where the context.area returns None.

But after second thoughts, that doesn't make any sense. They both used window_manager.event_timer_add() and seems to use it to trigger the tag_redraw().

If window change would return None since 2013, then screencasekey addon shouldn't be able to sustain its redraw over time in blender 2.79, but it does sustain it.

There are no differences that I can perceive and understand between screencasekey for 2.79 and shortcut Vur for 2.8 on how they achieved the repeated redraw over time, and yet they behave differently in two blender versions.

There must be something different between blender 2.79 & 2.8 that caused this discrepancy.

I'm not sure what type of problem this is or what is wrong, but I hope blender 2.8 can behave in the same way as 2.79 in this specific case.

Exact Description of this issue

System Information
Win 10 Pro,
AMD 1700x w 32GB & 1080

Blender Version
Broken:
2.8 positive symptom with Shortcut VUR addon and with my own script.

Worked: (optional)
2.79 with screencast key addon

Short description of error
Note: I don't think this is a problem on the Addon part since screencastkeys on 2.79 used the exact same method to achieve timely redraw for the on-screen messages.

Without window layout change, both addons worked correctly, the on-screen input message disappears after a short time.

After window layout change, context.area within MODAL method returns None, and on-screen input messages would not refresh until triggered by another input.

Returning to previous window layout won't fix the issue.

The event 'TIMER' is still triggered consistently, the screen though, would not redraw when the 'TIMER' event hits.

Exact steps for others to reproduce the error
1, Enable said addons in their corresponding version of Blender,
2, Start the modal operator with the button in the Side panel
3, Observe as the input messages disappear
4, Maximize the window, or change to a different layout
5, Notice the messages do not disappear unless new input such as MouseWheelScroll happens, and it would timely redraw for a second or two, and stop again.

According to the report here, context loss is a designed behavior of modal operator.
https://developer.blender.org/T36711

The fact it worked in 2.7 across different windows seems to be a glitch. But in the case of casting inputs from modal operator, it did work better.

2.8 version of the screencastkeys had defined a method to find the active window/area for the script to work when maximizing a window, but upon workspace change, the display will disappear completely.

https://developer.blender.org/T61764 As the above report mentioned, I suspected that in 2.8, the redraw stopped because of the loss of context, where the context.area returns None. But after second thoughts, that doesn't make any sense. They both used window_manager.event_timer_add() and seems to use it to trigger the tag_redraw(). If window change would return None since 2013, then screencasekey addon shouldn't be able to sustain its redraw over time in blender 2.79, but it does sustain it. There are no differences that I can perceive and understand between screencasekey for 2.79 and shortcut Vur for 2.8 on how they achieved the repeated redraw over time, and yet they behave differently in two blender versions. There must be something different between blender 2.79 & 2.8 that caused this discrepancy. I'm not sure what type of problem this is or what is wrong, but I hope blender 2.8 can behave in the same way as 2.79 in this specific case. **Exact Description of this issue** **System Information** Win 10 Pro, AMD 1700x w 32GB & 1080 **Blender Version** Broken: 2.8 positive symptom with Shortcut VUR addon and with my own script. Worked: (optional) 2.79 with screencast key addon **Short description of error** Note: I don't think this is a problem on the Addon part since screencastkeys on 2.79 used the exact same method to achieve timely redraw for the on-screen messages. Without window layout change, both addons worked correctly, the on-screen input message disappears after a short time. After window layout change, context.area within MODAL method returns None, and on-screen input messages would not refresh until triggered by another input. Returning to previous window layout won't fix the issue. The event 'TIMER' is still triggered consistently, the screen though, would not redraw when the 'TIMER' event hits. **Exact steps for others to reproduce the error** 1, Enable said addons in their corresponding version of Blender, 2, Start the modal operator with the button in the Side panel 3, Observe as the input messages disappear 4, Maximize the window, or change to a different layout 5, Notice the messages do not disappear unless new input such as MouseWheelScroll happens, and it would timely redraw for a second or two, and stop again. According to the report here, context loss is a designed behavior of modal operator. https://developer.blender.org/T36711 The fact it worked in 2.7 across different windows seems to be a glitch. But in the case of casting inputs from modal operator, it did work better. 2.8 version of the screencastkeys had defined a method to find the active window/area for the script to work when maximizing a window, but upon workspace change, the display will disappear completely.
Author

Added subscriber: @remotecrab131

Added subscriber: @remotecrab131
Brent Lio changed title from tag_redraw() stops working in 2.8 after context change but works in 2.7? to tag_redraw() stops working in 2.8 after context change but works in 2.7? Problem of event_timer_add()? 2019-02-21 21:43:43 +01:00
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Could you provide some instructions that allow us to reproduce the issue easily?

Try to be more precise about what the problem actually is.

Furthermore, please mention what exact version of Blender you are using.

Could you provide some instructions that allow us to reproduce the issue easily? Try to be more precise about what the problem actually is. Furthermore, please mention what exact version of Blender you are using.
Author

In #61822#625857, @JacquesLucke wrote:
Furthermore, please mention what exact version of Blender you are using.

sorry, I left the details to the previous report I made, which is here:
https://developer.blender.org/T61764

> In #61822#625857, @JacquesLucke wrote: > Furthermore, please mention what exact version of Blender you are using. sorry, I left the details to the previous report I made, which is here: https://developer.blender.org/T61764
Member

Why did you make two reports in the first place when they are talking about the same thing?

Could you please provide all the necessary information in one place?
You can update the original description of this report.

Make sure that you provide very clear and easy to follow steps to reproduce the issue.

Thanks you :)

Why did you make two reports in the first place when they are talking about the same thing? Could you please provide all the necessary information in one place? You can update the original description of this report. Make sure that you provide very clear and easy to follow steps to reproduce the issue. Thanks you :)
Author

In #61822#628798, @JacquesLucke wrote:
Why did you make two reports in the first place when they are talking about the same thing?

I could've just edited the title, I didn't. I guess it was my mistake thinking it's okay to post a new one. I apologize.

At the time I was thinking too much about why it behaved differently and thought I was describing 2 different issues since the first report I posted was about context.area == None causing the problem, but I felt it wasn't really the issue here.

> In #61822#628798, @JacquesLucke wrote: > Why did you make two reports in the first place when they are talking about the same thing? I could've just edited the title, I didn't. I guess it was my mistake thinking it's okay to post a new one. I apologize. At the time I was thinking too much about why it behaved differently and thought I was describing 2 different issues since the first report I posted was about context.area == None causing the problem, but I felt it wasn't really the issue here.
Member

Which screencast keys addon are you using? Where can I get it?

Which screencast keys addon are you using? Where can I get it?
Author

Using this with Blender 2.7x allows the redraw to be triggered based on the window event timer after switching windows. No matter what layout changed, this consistently redraws based on the window event timer.
Old Screencast_key addon for 2.7x
https://github.com/sftd/blender-addons/blob/master/space_view3d_screencast_keys.py

Using this in 2.8 will cause the window event timer to trigger, but viewport will stop refreshing after a few seconds.
ShortcutVUr for 2.8
https://github.com/jayanam/shortcut_VUr

This is a supplemental example, it attaches the event timer on multiple window/area in order to solve the problem described above. However, it only works when maximizing/restoring the active window. This does not display anything in workspaces that the addon operator didn't start in.
New Screencast_key addon for 2.8
https://github.com/nutti/Screencast-Keys

**Using this with Blender 2.7x allows the redraw to be triggered based on the window event timer after switching windows. No matter what layout changed, this consistently redraws based on the window event timer.** Old Screencast_key addon for 2.7x https://github.com/sftd/blender-addons/blob/master/space_view3d_screencast_keys.py **Using this in 2.8 will cause the window event timer to trigger, but viewport will stop refreshing after a few seconds.** ShortcutVUr for 2.8 https://github.com/jayanam/shortcut_VUr **This is a supplemental example, it attaches the event timer on multiple window/area in order to solve the problem described above. However, it only works when maximizing/restoring the active window. This does not display anything in workspaces that the addon operator didn't start in.** New Screencast_key addon for 2.8 https://github.com/nutti/Screencast-Keys

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sebastian Parborg self-assigned this 2019-06-11 11:16:30 +02:00

I can't seem to reproduce this issue with shortcut_VUr. The viewport seems to update fine.

If this is still an issue for you, let me know and we'll reopen this,

I can't seem to reproduce this issue with `shortcut_VUr`. The viewport seems to update fine. If this is still an issue for you, let me know and we'll reopen this,
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#61822
No description provided.