selecting a grease pencil layer in dopesheet and timeline does NOT register anywhere #104601

Closed
opened 2023-02-11 00:32:14 +01:00 by Alex Mehler · 3 comments

When you select a grease pencil layer in the Object Data Properties, blender registers this in the Info tab and also possible to register a bpy.msgbus.subscribe_rna callback to the active layer.

But when selecting a layer in dopesheet, even though it also changes the active layer in Object Data Properties, blender doesnt register this at all.

Would be nice if this is added as its kind of missing.

In actual animation work you would select the layer 98% of times through the dopesheet and not Object Data Properties.

Writing an addon which does something on layer activation is now only possible with polling or bpy.app.handlers.depsgraph_update_post.append

When you select a grease pencil layer in the Object Data Properties, blender registers this in the Info tab and also possible to register a bpy.msgbus.subscribe_rna callback to the active layer. But when selecting a layer in dopesheet, even though it also changes the active layer in Object Data Properties, blender doesnt register this at all. Would be nice if this is added as its kind of missing. In actual animation work you would select the layer 98% of times through the dopesheet and not Object Data Properties. Writing an addon which does something on layer activation is now only possible with polling or bpy.app.handlers.depsgraph_update_post.append
Alex Mehler added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-02-11 00:32:15 +01:00
Member

Which blender version are you using?
Has this ever worked before?

Could you attach a simple .blend example (including some py code) that shows the difference? (this should help speed up the process when multiple devs are looking at this issue)

Which blender version are you using? Has this ever worked before? Could you attach a simple .blend example (including some py code) that shows the difference? (this should help speed up the process when multiple devs are looking at this issue)
Philipp Oeser added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-02-13 13:19:08 +01:00
Author

this is the default 2d animation file, just look at the info panel and switch layers in dopesheet and in object data properties. in properties it registers in dopesheet it doesnt.

This affects msgbus too, the signal isnt send

this is the default 2d animation file, just look at the info panel and switch layers in dopesheet and in object data properties. in properties it registers in dopesheet it doesnt. This affects msgbus too, the signal isnt send
Philipp Oeser added
Status
Needs Triage
and removed
Status
Needs Information from User
labels 2023-03-29 12:42:59 +02:00
Member

Hi, channel selection in anim-editors and layer selection in UI list are both handled differently.

For animation editor:
For operators, report is generated after execution only if OPTYPE_REGISTER flag is set, see:
https://projects.blender.org/blender/blender/src/branch/main/source/blender/windowmanager/intern/wm_event_system.cc#L1081

    if (op->type->flag & OPTYPE_REGISTER) {
      if (G.background == 0) { /* Ends up printing these in the terminal, gets annoying. */
        /* Report the python string representation of the operator. */
        char *buf = WM_operator_pystring(C, op, false, true);
        BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
        MEM_freeN(buf);
      }
    }

Clicking on channel invokes ANIM_OT_channels_click operator and register flag is not set purposefully for this operator (to not expose redo panel?).


In case of Object Data Properties tab:
These Layers are button list, clicking/selecting them calls rna function rna_GPencil_active_layer_index_set to update the property.
For these UI, report is generated in ui_apply_but_autokey


even though it also changes the active layer in Object Data Properties

Not sure which exact function does the syncing of animchannels with UI.


AFAICS this is working as expected. The issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors.

For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug

Closing this report. Feel free to comment if there is misunderstanding.

Hi, channel selection in anim-editors and layer selection in UI list are both handled differently. **For animation editor:** For operators, report is generated after execution only if `OPTYPE_REGISTER` flag is set, see: https://projects.blender.org/blender/blender/src/branch/main/source/blender/windowmanager/intern/wm_event_system.cc#L1081 ``` if (op->type->flag & OPTYPE_REGISTER) { if (G.background == 0) { /* Ends up printing these in the terminal, gets annoying. */ /* Report the python string representation of the operator. */ char *buf = WM_operator_pystring(C, op, false, true); BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf); MEM_freeN(buf); } } ``` Clicking on channel invokes `ANIM_OT_channels_click` operator and `register` flag is not set purposefully for this operator (to not expose redo panel?). - - - **In case of Object Data Properties tab:** These Layers are button list, clicking/selecting them calls rna function `rna_GPencil_active_layer_index_set` to update the property. For these UI, report is generated in `ui_apply_but_autokey` - - - > even though it also changes the active layer in Object Data Properties Not sure which exact function does the syncing of animchannels with UI. - - - AFAICS this is working as expected. The issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors. For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug Closing this report. Feel free to comment if there is misunderstanding.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-04-12 14:16:50 +02: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
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#104601
No description provided.