Animation playback is not synchronized when Screen Layout changes #38467

Closed
opened 2014-02-03 23:07:52 +01:00 by Paulo José Oliveira Amaro · 16 comments

System Information
Ubuntu 13.10 32-bit
Intel Ironlake Mobile x86/MMX/SSE

Blender Version
2.69.10 f70d966

Short description of error
The UI don't update correctly when animation is playing and the Screen Layout is changed. The UI animation indicators are not correct and the animation controls don't work properly.

Exact steps for others to reproduce the error
Very easy to reproduce:

  1. Start new file and play animation with button or CTRL+A;
  2. Change the Screen Layout to "Animation". The interface is not updated and CTRL+A or interface buttons don't stop the animation.

Another way to check this:

  1. Add a sound strip to Video Sequencer.
  2. Then change the layout while playing animation and try to stop the animation. The sound will continue to play until you try to stop the animation again.

A last note: If you start to play animation in two layouts at the same time, the same problem will happen if you try to stop the animation in one of then. In the another layout it will keep to playing incorrectly.

**System Information** Ubuntu 13.10 32-bit Intel Ironlake Mobile x86/MMX/SSE **Blender Version** 2.69.10 f70d966 **Short description of error** The UI don't update correctly when animation is playing and the Screen Layout is changed. The UI animation indicators are not correct and the animation controls don't work properly. **Exact steps for others to reproduce the error** Very easy to reproduce: 1. Start new file and play animation with button or CTRL+A; 2. Change the Screen Layout to "Animation". The interface is not updated and CTRL+A or interface buttons don't stop the animation. Another way to check this: 1. Add a sound strip to Video Sequencer. 2. Then change the layout while playing animation and try to stop the animation. The sound will continue to play until you try to stop the animation again. A last note: If you start to play animation in two layouts at the same time, the same problem will happen if you try to stop the animation in one of then. In the another layout it will keep to playing incorrectly.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @PauloJoseOliveiraAmaro

Added subscriber: @PauloJoseOliveiraAmaro

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

I observer something else here on Mac OS, after switching to the "animation" screen layout, the playback stops. Pressing ALT+A again and it starts to playback again,

I observer something else here on Mac OS, after switching to the "animation" screen layout, the playback stops. Pressing ALT+A again and it starts to playback again,
Member

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung
Member

IIRC, the temporary data for animation playback - settings + timer - are actually stored on a per-screen basis. While this is perhaps related to Ton's dream/plan to make it possible to have different windows playing back independently of each other at some point, it can lead to various weird situations like the one described here.

Perhaps we should move to storing this stuff in wmWindowManager instead of bScreen. I'm not sure it's such a great idea to mix this sort of thing in with the windowmanager module (since it's kindof lower-level than the Screens/UI elements stuff). Then again, wm_event_do_handlers() already has to have special handling for sound playback and performing depsgraph+eval system updates...

IIRC, the temporary data for animation playback - settings + timer - are actually stored on a per-screen basis. While this is perhaps related to Ton's dream/plan to make it possible to have different windows playing back independently of each other at some point, it can lead to various weird situations like the one described here. Perhaps we should move to storing this stuff in wmWindowManager instead of bScreen. I'm not sure it's such a great idea to mix this sort of thing in with the windowmanager module (since it's kindof lower-level than the Screens/UI elements stuff). Then again, wm_event_do_handlers() already has to have special handling for sound playback and performing depsgraph+eval system updates...

Added subscribers: @brecht, @Sergey

Added subscribers: @brecht, @Sergey

I wouldn't want this to be moved. We're actually moving towards separate states for windows and such a change would be a step backwards actually. But perhaps user feedback could be improved here.

@brecht, any thoughts here?

I wouldn't want this to be moved. We're actually moving towards separate states for windows and such a change would be a step backwards actually. But perhaps user feedback could be improved here. @brecht, any thoughts here?

We can keep it in the screen for later, but need to ensure only one screen s playing at a time, and stopping (or transferring) playback when switching screens.

We can keep it in the screen for later, but need to ensure only one screen s playing at a time, and stopping (or transferring) playback when switching screens.

Added subscriber: @mont29

Added subscriber: @mont29

This simple patch seems to work as expected... Not quite sure a mere copy of animtimer between screens is a correct way to do it, though!

P17: source/blender/editors/screen/screen_edit.c

diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 86e7839..66fa578 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1518,8 +1518,17 @@ void ED_screen_set(bContext *C, bScreen *sc)
                        WM_event_timer_sleep(wm, win, wt, true);
                
                ED_screen_exit(C, win, oldscreen);
-               oldscreen->animtimer = wt;
-               
+
+               /* Same scene, "transfer" playback to new screen. */
+               if (oldscene == sc->scene) {
+                       sc->animtimer = wt;
+               }
+               /* Else, stop playback. */
+               else {
+                       oldscreen->animtimer = wt;
+                       ED_screen_animation_play(C, 0, 0);
+               }
+
                win->screen = sc;
                CTX_wm_window_set(C, win);  // stores C->wm.screen... hrmf
                

This simple patch **seems** to work as expected... Not quite sure a mere copy of animtimer between screens is a correct way to do it, though! [P17: source/blender/editors/screen/screen_edit.c](https://archive.blender.org/developer/P17.txt) ``` diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 86e7839..66fa578 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1518,8 +1518,17 @@ void ED_screen_set(bContext *C, bScreen *sc) WM_event_timer_sleep(wm, win, wt, true); ED_screen_exit(C, win, oldscreen); - oldscreen->animtimer = wt; - + + /* Same scene, "transfer" playback to new screen. */ + if (oldscene == sc->scene) { + sc->animtimer = wt; + } + /* Else, stop playback. */ + else { + oldscreen->animtimer = wt; + ED_screen_animation_play(C, 0, 0); + } + win->screen = sc; CTX_wm_window_set(C, win); // stores C->wm.screen... hrmf ```

Looks good to me.

I can't see anything in wmTimer that binds it to any screen specifically, only to the window which stays the same. And animtimer seems to be the only variable in bScreen affected by animation playback, so that seems ok too.

Looks good to me. I can't see anything in wmTimer that binds it to any screen specifically, only to the window which stays the same. And animtimer seems to be the only variable in bScreen affected by animation playback, so that seems ok too.
Bastien Montagne self-assigned this 2014-02-28 10:02:21 +01:00

This issue was referenced by blender/blender-addons-contrib@d2a5ea04ed

This issue was referenced by blender/blender-addons-contrib@d2a5ea04ed8448865b4daa21c0010727eee118ba

This issue was referenced by d2a5ea04ed

This issue was referenced by d2a5ea04ed8448865b4daa21c0010727eee118ba

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit d2a5ea04ed.

Closed by commit d2a5ea04ed.
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
7 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#38467
No description provided.