Grease pencil draw operator is not working in the sequencer #49378

Closed
opened 2016-09-16 14:45:51 +02:00 by Vincent Girès · 7 comments

System Information
Win 10 / Quadro 4000

Blender Version
Broken: (example: 2.78 RC2)

Short description of error
The draw operator of the grease pencil is not working in the sequencer area.
layout.operator("gpencil.draw").mode = 'DRAW' enable the draw cursor, but stop as soon as the button is pressed.
bpy.ops.gpencil.draw(mode='DRAW') does nothing at all.
The only thing that is working is to draw with the "D" shortcut.

Exact steps for others to reproduce the error
Load the .blend, execute the script and try to use the draw buttons in the properties panel of the VSE.

sequencer_gp_draw_bug.blend

**System Information** Win 10 / Quadro 4000 **Blender Version** Broken: (example: 2.78 RC2) **Short description of error** The draw operator of the grease pencil is not working in the sequencer area. layout.operator("gpencil.draw").mode = 'DRAW' enable the draw cursor, but stop as soon as the button is pressed. bpy.ops.gpencil.draw(mode='DRAW') does nothing at all. The only thing that is working is to draw with the "D" shortcut. **Exact steps for others to reproduce the error** Load the .blend, execute the script and try to use the draw buttons in the properties panel of the VSE. [sequencer_gp_draw_bug.blend](https://archive.blender.org/developer/F361116/sequencer_gp_draw_bug.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @VincentGires

Added subscriber: @VincentGires

Added subscribers: @JoshuaLeung, @antoniov

Added subscribers: @JoshuaLeung, @antoniov

I not sure we can consider this as a bug. The draw button is not available for some reasons in the sequence panel. If you create a new panel yourself, we maybe can support this, but need review.

@JoshuaLeung what do you think? I have checked the code and the trick is that BLI_rcti_isect_pt_v function return false because the visble rect in ED_region_visible_rect is (0, 0 ,0, 0).

I not sure we can consider this as a bug. The draw button is not available for some reasons in the sequence panel. If you create a new panel yourself, we maybe can support this, but need review. @JoshuaLeung what do you think? I have checked the code and the trick is that BLI_rcti_isect_pt_v function return false because the visble rect in ED_region_visible_rect is (0, 0 ,0, 0).
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Joshua Leung self-assigned this 2016-09-17 16:06:22 +02:00
Member

Not a bug.

  1. The toolshelf in the 3D view is only for the 3D view, and nothing else. Occasionally you might get lucky with an operator that doesn't care about which editor it's called from. But for everything else where the editor does matter (e.g. the draw operator here, most of the other Grease Pencil operators, and anything in the animation editors are good examples), those operators won't really work because when you click on the button in the toolshelf, you're activating the operator in the 3D view that hosts the button + region that the button lives in. By and large, there isn't really any way to really know with any certainty which editor you had been intending the action to get directed to.

  2. The Grease Pencil draw operator needs to know about which editor it's working in, as each editor could have a different GP datablock active (e.g. if you have both a 3D view + a sequencer view open at the same time)

  3. The behaviour you're seeing where the operator exits as soon as you click somewhere in the sequencer is a consequence of a very deliberate feature to make the draw operator usable for people using a tablet only (without easy/convenient access to a keyboard). Namely, the operator is set up so that if you click outside the region (or the same area/editor, when invoking from the toolshelf/header) in which the operator was invoked, that is taken a sign that you've finished drawing and want to exit drawmode. Without this feature, it was impossible for some users to get out of draw mode when drawing with just a tablet (and the keyboard is out of reach for various reasons).


  1. As for why there isn't a toolshelf in the Sequencer: You'll have to ask the UI team about that one ;) Part of this might really boil down to a mixture of "not enough need" and/or a lack of interest in trying to find a way to shoehorn such a layout tweak into the code for this editor (and also ensure that all old files will load it correctly too)

On a more serious note, that's why for the most critical settings, we have a special panel (the "Grease Pencil Settings") panel. If you really need to have a button to launch this operator, I suggest putting it there. (Also, watch out for which "operator_context" the button will be executing stuff with...

Not a bug. 1) The toolshelf in the 3D view is **only** for the 3D view, and nothing else. Occasionally you might get lucky with an operator that doesn't care about which editor it's called from. But for everything else where the editor does matter (e.g. the draw operator here, most of the other Grease Pencil operators, and anything in the animation editors are good examples), those operators won't really work because when you click on the button in the toolshelf, you're activating the operator in the 3D view that hosts the button + region that the button lives in. By and large, there isn't really any way to really know with any certainty *which* editor you had been intending the action to get directed to. 2) The Grease Pencil draw operator needs to know about which editor it's working in, as each editor could have a different GP datablock active (e.g. if you have both a 3D view + a sequencer view open at the same time) 3) The behaviour you're seeing where the operator exits as soon as you click somewhere in the sequencer is a consequence of a very deliberate feature to make the draw operator usable for people using a tablet only (without easy/convenient access to a keyboard). Namely, the operator is set up so that if you click outside the region (or the same area/editor, when invoking from the toolshelf/header) in which the operator was invoked, that is taken a sign that you've finished drawing and want to exit drawmode. Without this feature, it was impossible for some users to get out of draw mode when drawing with just a tablet (and the keyboard is out of reach for various reasons). --- 4) As for why there isn't a toolshelf in the Sequencer: You'll have to ask the UI team about that one ;) Part of this might really boil down to a mixture of "not enough need" and/or a lack of interest in trying to find a way to shoehorn such a layout tweak into the code for this editor (and also ensure that all old files will load it correctly too) On a more serious note, that's why for the most critical settings, we have a special panel (the "Grease Pencil Settings") panel. If you really need to have a button to launch this operator, I suggest putting it there. (Also, watch out for which "operator_context" the button will be executing stuff with...
Sign in to join this conversation.
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-addons#49378
No description provided.