Annotations Panel updates in Right Sidebar 1 Frame delayed #81857

Open
opened 2020-10-19 16:31:19 +02:00 by Daniel Houghton · 13 comments

System Information
Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 5500M OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.18

Blender Version
Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: 3e85bb34d0
Worked: (newest version of Blender that worked as expected)

Short description of error
If you have two annotations and you start framing forward from the first to the second, the second annotation will show up in the 3D viewport on the correct frame, but the Annotations Panel in the Right Side Panel of the 3D viewport doesn't update until the following frame.

Exact steps for others to reproduce the error

  1. Hold down D to write an annotation of the letter "A."
  2. Use Right Arrow to go to Frame 10.
  3. Hold down D to write an annotation of the letter "B."
  4. Use Left Arrow to go back to Frame 9.
  5. Look at the Annotations Panel, it should incorrectly say "Frame: 10 (Unlocked)"
  6. Use Left Arrow to go back to Frame 8.
  7. Look at the Annotations Panel, it should now correctly say "Frame: 1 (Unlocked)"
  8. Arrow back and forth between Frames 8 and 12 and you should see the delay in both directions.

Thank you for taking a look at this!!
Daniel

Screen Shot 2020-10-19 at 10.26.03 AM.png

**System Information** Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 5500M OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.18 **Blender Version** Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: `3e85bb34d0` Worked: (newest version of Blender that worked as expected) **Short description of error** If you have two annotations and you start framing forward from the first to the second, the second annotation will show up in the 3D viewport on the correct frame, but the Annotations Panel in the Right Side Panel of the 3D viewport doesn't update until the following frame. **Exact steps for others to reproduce the error** 1) Hold down D to write an annotation of the letter "A." 2) Use Right Arrow to go to Frame 10. 3) Hold down D to write an annotation of the letter "B." 4) Use Left Arrow to go back to Frame 9. 5) Look at the Annotations Panel, it should incorrectly say "Frame: 10 (Unlocked)" 6) Use Left Arrow to go back to Frame 8. 7) Look at the Annotations Panel, it should now correctly say "Frame: 1 (Unlocked)" 8) Arrow back and forth between Frames 8 and 12 and you should see the delay in both directions. Thank you for taking a look at this!! Daniel ![Screen Shot 2020-10-19 at 10.26.03 AM.png](https://archive.blender.org/developer/F9016348/Screen_Shot_2020-10-19_at_10.26.03_AM.png)
Author
Member

Added subscriber: @DanielHoughton

Added subscriber: @DanielHoughton
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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

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

Can confirm, refreshes when hovering over the panel.

Can confirm, refreshes when hovering over the panel.
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

This looks like a missing redraw. Using the "current frame" button in the outliner works, so I expect the frame offset operator doesn't do proper updating.

This looks like a missing redraw. Using the "current frame" button in the outliner works, so I expect the frame offset operator doesn't do proper updating.
Hans Goudey self-assigned this 2020-10-19 18:00:29 +02:00
Hans Goudey removed their assignment 2020-10-19 18:28:36 +02:00
Member

Added subscriber: @antoniov

Added subscriber: @antoniov
Member

@antoniov It looks like the active frame for the annotation gpencil layer is used for the frame label here, and it's one redraw step behind. That seems like a larger issue in itself, but maybe not?

Anyway, it could be easily covered up by just using scene.frame_current for this label, but that might be wrong too. We definitely need Antonio's expertise here.

@antoniov It looks like the active frame for the annotation gpencil layer is used for the frame label here, and it's one redraw step behind. That seems like a larger issue in itself, but maybe not? Anyway, it could be easily covered up by just using `scene.frame_current` for this label, but that might be wrong too. We definitely need Antonio's expertise here.
Member

Same is true for frame_jump, keyframe_jump, marker_jump btw.

Might be wrong, but suspect this is because of BKE_gpencil_layer_frame_get [which sets the active frame - and is called from drawing... annotation_draw_data_layers].
Not sure drawing code should set data in this way?

Same is true for `frame_jump`, `keyframe_jump`, `marker_jump` btw. Might be wrong, but suspect this is because of `BKE_gpencil_layer_frame_get` [which sets the active frame - and is called from **drawing**... `annotation_draw_data_layers`]. Not sure drawing code should set data in this way?

I'm going to look at code to see what active frame you get when move.

I'm going to look at code to see what active frame you get when move.

I have checked and when you move the keyframe, active frame changed, so it's only a problem with the panel refresh.

You can check easily using this python line in the console:

bpy.data.grease_pencils- [x].layers- [x].active_frame.frame_number

When you are in frame 9, the result of the python above is 1, and moving the cursor over the panel the buton is updated.

So, @HooglyBoogly you can add the redraw tag and the panel must be updated as expected.

I have checked and when you move the keyframe, active frame changed, so it's only a problem with the panel refresh. You can check easily using this python line in the console: `bpy.data.grease_pencils- [x].layers- [x].active_frame.frame_number` When you are in frame `9`, the result of the python above is `1`, and moving the cursor over the panel the buton is updated. So, @HooglyBoogly you can add the redraw tag and the panel must be updated as expected.

As side note about the logic behind.

The active frame is set in BKE_gpencil_frame_active_set() function. When the frame change is evaluated and the function assigned in build_object_data_geometry_datablock() is called, the frame number is calculated.

The function BKE_gpencil_layer_frame_get() just try to read the active frame, and if the active frame is not correct, then is recalculated. Usually, this funtion returns the gpl->actframe because if all is working with no bugs, the active frame is already available. Only if you add new frames or some special cases, the actframe must be calculated in this function.

EDIT: Looking at the debug, it looks the annotations are not working as I explained above. The depsgraph never call the BKE_gpencil_frame_active_set() function, and all is updated in BKE_gpencil_layer_frame_get() function. Don't know if this is a problem because the draw is done after the panel update or not.

As side note about the logic behind. The active frame is set in `BKE_gpencil_frame_active_set()` function. When the frame change is evaluated and the function assigned in `build_object_data_geometry_datablock()` is called, the frame number is calculated. The function `BKE_gpencil_layer_frame_get()` just try to read the active frame, and if the active frame is not correct, then is recalculated. Usually, this funtion returns the `gpl->actframe` because if all is working with no bugs, the active frame is already available. Only if you add new frames or some special cases, the `actframe` must be calculated in this function. EDIT: Looking at the debug, it looks the annotations are not working as I explained above. The depsgraph never call the `BKE_gpencil_frame_active_set()` function, and all is updated in `BKE_gpencil_layer_frame_get()` function. Don't know if this is a problem because the draw is done after the panel update or not.

We maybe need something like this:

index fe1c5efc747..c8e82a0cba6 100644
    - a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -689,10 +689,14 @@ static void annotation_draw_data_layers(

}


/* get frame to draw */

+    int oldframenum = gpl->actframe ? gpl->actframe->framenum : 0;

bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, cfra, GP_GETFRAME_USE_PREV);
if (gpf == NULL) {
continue;
}

+    if (gpf->framenum != oldframenum) {
+      // Update panel here
+    }

/* Add layer drawing settings to the set of "draw flags"

      * NOTE: If the setting doesn't apply, it *must* be cleared,

I don't know what is the right code to update the panel, but must be in the comment line above.

We maybe need something like this: ```diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index fe1c5efc747..c8e82a0cba6 100644 - a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -689,10 +689,14 @@ static void annotation_draw_data_layers( ``` } ``` ``` /* get frame to draw */ ``` + int oldframenum = gpl->actframe ? gpl->actframe->framenum : 0; ``` bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, cfra, GP_GETFRAME_USE_PREV); if (gpf == NULL) { continue; } ``` + if (gpf->framenum != oldframenum) { + // Update panel here + } ``` /* Add layer drawing settings to the set of "draw flags" ``` * NOTE: If the setting doesn't apply, it *must* be cleared, ``` I don't know what is the right code to update the panel, but must be in the comment line above.
Philipp Oeser removed the
Interest
Grease Pencil
label 2023-02-09 15:19:44 +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#81857
No description provided.