Tablet not drawing - moving pen causes drawing to break #79335

Closed
opened 2020-07-28 06:40:45 +02:00 by Phil Smy · 15 comments

System Information
Operating system: MacOS 10.15.5 (19F101)
Graphics card: AMD Radeon Pro 5300M 4 GB
Intel UHD Graphics 630 1536 MB
(I am on a MacBook Pro (16-inch, 2019))

Blender Version
Broken: 2.83.2 2020-07-09, also 2.90.0 2020-07-27

Worked: None

Short description of error
I have 2 graphics tablets - a Huion 610Pro and an XP-PEN Artist 12 - and both exhibit the same behavior: unable to draw in 2d mode.

Exact steps for others to reproduce the error

  1. Open Blender
  2. Choose 2D Animation from the splash screen
  3. Can draw using the mouse
  4. Bring tablet pen onscreen (don't need to click, simply moving the cursor with the pen does it)
  5. Can no longer draw with mouse(!)
  6. Cannot draw with pen

Both tablets work perfectly fine in other applications (eg Photoshop). I actually bought the XPPen because I thought the Huion was old and maybe that was the issue.
The bizarre thing is that simply moving the cursor with the tablet causes the issue. You do NOT need to touch pen to tablet and try to draw.

I tried this with 'clean' settings (i.e Load Default) and also with Emulate 3 Button Mouse.

I also turned on Screencast keys to see if some command was being issued by the tablets, but I see nothing coming through.

**System Information** Operating system: MacOS 10.15.5 (19F101) Graphics card: AMD Radeon Pro 5300M 4 GB Intel UHD Graphics 630 1536 MB (I am on a MacBook Pro (16-inch, 2019)) **Blender Version** Broken: 2.83.2 2020-07-09, also 2.90.0 2020-07-27 Worked: None **Short description of error** I have 2 graphics tablets - a Huion 610Pro and an XP-PEN Artist 12 - and both exhibit the same behavior: unable to draw in 2d mode. **Exact steps for others to reproduce the error** 1) Open Blender 2) Choose 2D Animation from the splash screen 3) Can draw using the mouse 4) Bring tablet pen onscreen (don't need to click, simply moving the cursor with the pen does it) 5) Can no longer draw with mouse(!) 6) Cannot draw with pen Both tablets work perfectly fine in other applications (eg Photoshop). I actually bought the XPPen because I thought the Huion was old and maybe that was the issue. The bizarre thing is that simply moving the cursor with the tablet causes the issue. You do NOT need to touch pen to tablet and try to draw. I tried this with 'clean' settings (i.e Load Default) and also with Emulate 3 Button Mouse. I also turned on Screencast keys to see if some command was being issued by the tablets, but I see nothing coming through.
Author

Added subscriber: @philinjp

Added subscriber: @philinjp
Author

Ok, looking around more I found this bug report: https://developer.blender.org/T62565

In it there is discussion of tablet pressure. So, I decided to run Blender 2.83.2 with --debug-events and see, and sure enough that does seem to be the issue.

wm_event_do_handlers: Handling event
wmEvent  type:1 / LEFTMOUSE, val:2 / RELEASE,
         prev_type:1 / LEFTMOUSE, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(1836,636), ascii:'', utf8:'', pointer:0x7fd10cc2b028
 tablet: active: 1, pressure 0.0000, tilt: (0.0000 0.0000)

Now, in bug https://developer.blender.org/T62565 it says that a fix was put in place for 2.83. As far as I can tell both 2.83 and 2.9 still exhibit this behavior.

So - the questions are:

  1. Was this actually implemented/committed/rolled out?
  2. How can I fix this so I can actually use my tablet?
Ok, looking around more I found this bug report: https://developer.blender.org/T62565 In it there is discussion of tablet pressure. So, I decided to run Blender 2.83.2 with `--debug-events` and see, and sure enough that does seem to be the issue. ``` wm_event_do_handlers: Handling event wmEvent type:1 / LEFTMOUSE, val:2 / RELEASE, prev_type:1 / LEFTMOUSE, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(1836,636), ascii:'', utf8:'', pointer:0x7fd10cc2b028 tablet: active: 1, pressure 0.0000, tilt: (0.0000 0.0000) ``` Now, in bug https://developer.blender.org/T62565 it says that a fix was put in place for 2.83. As far as I can tell both 2.83 and 2.9 still exhibit this behavior. So - the questions are: 1) Was this actually implemented/committed/rolled out? 2) How can I fix this so I can actually use my tablet?

Added subscribers: @PrototypeNM1, @iss

Added subscribers: @PrototypeNM1, @iss

@PrototypeNM1 can you look at this?

@PrototypeNM1 can you look at this?

Added subscriber: @ArtoKitula

Added subscriber: @ArtoKitula

@iss issue is macOS specific, unfortunately not my area. :(

Maybe an issue for @ArtoKitula?

@iss issue is macOS specific, unfortunately not my area. :( Maybe an issue for @ArtoKitula?
Author

More observations. I compiled my own version so I could add some debugging information and hard coded values to see what's going on.

In gpencil_paint.c in the gpencil_draw_apply_event method the event->tablet.pressure is always 0 when it comes from my tablets. If I hard-code in a value later by inserting this around line 2800

  if (p->pressure < 0.001f) {
    p->pressure = 0.75f;
    if (G.debug & G_DEBUG) {
      printf("GPencil - gpencil_draw_apply_event manually setting pressure: %.4f\n", p->pressure);
    }
  }

Then I get the debug string and I can actually draw! Of course the pressure never changes, but it is a step in the right direction.
Whatever is firing the event is not reading the pressure from my tablet. Could this be configuration on my side? Perhaps. But I did no configuration to get the pen to work in Photoshop, and the Pen Tablet tool reports varying pressure.

The other thing I have noticed, digging into this more, is that after trying to use the tablet, the debug messages will ALWAYS print out

tablet: active: 1 pressure: 0.0000

even if I go back to trying to draw with the mouse.
Perhaps this is expected behavior?

More observations. I compiled my own version so I could add some debugging information and hard coded values to see what's going on. In `gpencil_paint.c` in the `gpencil_draw_apply_event` method the `event->tablet.pressure` is always 0 when it comes from my tablets. If I hard-code in a value later by inserting this around line 2800 ``` if (p->pressure < 0.001f) { p->pressure = 0.75f; if (G.debug & G_DEBUG) { printf("GPencil - gpencil_draw_apply_event manually setting pressure: %.4f\n", p->pressure); } } ``` Then I get the debug string and I can actually draw! Of course the pressure never changes, but it is a step in the right direction. Whatever is firing the event is not reading the pressure from my tablet. Could this be configuration on my side? Perhaps. But I did no configuration to get the pen to work in Photoshop, and the Pen Tablet tool reports varying pressure. The other thing I have noticed, digging into this more, is that after trying to use the tablet, the debug messages will ALWAYS print out `tablet: active: 1 pressure: 0.0000` even if I go back to trying to draw with the mouse. Perhaps this is expected behavior?
Author

FYI - annotation_draw_invoke in annotate_paint.c DOES work and does get correct tablet pressure.

Today is the first day I am looking at the Blender code, so I am not confident I will find the source of the event information.

Sorry for the spam. Last comment on this, I promise.

FYI - `annotation_draw_invoke` in `annotate_paint.c` DOES work and does get correct tablet pressure. Today is the first day I am looking at the Blender code, so I am not confident I will find the source of the event information. Sorry for the spam. Last comment on this, I promise.
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

@philinjp , thanks for trying, just want to know if this is still an issue for you.

Please comment here if you want to share any update regarding this task. (I don't have device to test this, unfortunately)

@philinjp , thanks for trying, just want to know if this is still an issue for you. Please comment here if you want to share any update regarding this task. (I don't have device to test this, unfortunately)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

A lot of time has passed since (and a lot of development/fixes, too).
@philinjp : could you check if you still have the problem in 3.1beta or 3.2alpha builds from https://builder.blender.org/download/daily/?

A lot of time has passed since (and a lot of development/fixes, too). @philinjp : could you check if you still have the problem in 3.1beta or 3.2alpha builds from https://builder.blender.org/download/daily/?
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
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
5 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#79335
No description provided.