godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.58k stars 21.1k forks source link

Godot 4 UI doesn't work with Wacom pen tablet #76451

Open NKO55 opened 1 year ago

NKO55 commented 1 year ago

Godot version

4.0.2

System information

Windows 11 N, Ryzen 9 7900X, 32 gb DDR5, RTX 3080 10 gb, Wacom Intuos 5

Issue description

Godot 4 UI seems to be broken when using Wacom Intuos 5 tablet with latest drivers. Turning Windows Ink On/Off from Wacom drivers doesn't make any difference. Examples of the issues:

1) In the viewport, right-clicking with the pen causes viewport to go crazy: view starts to orbit uncontrollably. While using regular mouse, you can orbit the view with ease.

2) While using mouse: you can change object values, like position or scale, by left-clicking on the value and sliding left or right. The value will change steadily based on your movement. If you try to do the same with wacom pen, the value starts to increase rapidly, whether you move cursor left or right.

Honestly, I was bit of disappointed by the lack of basic Wacom support in this app. Seems like no one tested it before release, and I wonder how can that be. Wacoms are used all over the industry. Most of the artists use Wacom. I use Wacom with every other app (Photoshop, Blender, Zbrush, Aseprite etc) without any problems. Jumping between the different programs is essential for fast workflow. Changing between regular mouse and wacom every few minutes would be very slow and cumbersome and not very efficient. Please, please, please, try to fix these issues as soon as possible! I can see great potential in Godot, but with this kind of simple oversight the whole user experience in the app is ruined.

Steps to reproduce

1) Have a wacom graphic tablet

2) Try to use it in godot 4

3) Suffering

Minimal reproduction project

N/A

capnm commented 1 year ago

See https://github.com/godotengine/godot/issues/75903#issuecomment-1504099251 , switching the tablet to relative mode might help.

Calinou commented 1 year ago

This sounds like pen inputs being unimplemented in Node3DEditorViewport and EditorSpinSlider. This makes the issue similar to https://github.com/godotengine/godot/issues/38237 and https://github.com/godotengine/godot/issues/49873.

Honestly, I was bit of disappointed by the lack of basic Wacom support in this app.

Most Godot contributors don't have access to any graphics tablet (or don't use one regularly), which makes implementing those features difficult.

capnm commented 1 year ago

This sounds like pen inputs being unimplemented in Node3DEditorViewport ...

As I can see (in Linux) pen inputs are also in Godot 4 handled with InputEventMouseMotion and that is supported in the 3DViewport and works as expected. So the issue might be somewhere else.

E.g. see the capture of velocity, pressure and tilt:

InputEventMouseMotion: button_mask=1 (Left Mouse Button), position=((131, 386)), relative=((-1, -1)),
velocity=((-9.95996, -49.7998)), pressure=0.08, tilt=((0.52381, -0.21875)), pen_inverted=(false)
NKO55 commented 1 year ago

This sounds like pen inputs being unimplemented in Node3DEditorViewport and EditorSpinSlider. This makes the issue similar to #38237 and #49873.

Honestly, I was bit of disappointed by the lack of basic Wacom support in this app.

Most Godot contributors don't have access to any graphics tablet (or don't use one regularly), which makes implementing those features difficult.

I realize my respond might’ve come across arrogant and indiscreet and I apologize for that! It’s just that I was genuinely surprised by the tablet issues I was having in Godot. Other than that issue, it seems like a really great piece of software so far!

Alriightyman commented 1 year ago

I have a Wacom Cintiq 16, which is a display tablet - though, I never thought to use it for Godot. I did try the 2 examples mentioned in the initial post and I do get the same problems. With that being said, switching to "relative mode" wouldn't help here since I don't actually have that option. I did notice that changing the Pen Tip "feel" to soft (slider all the way to the left) makes it a little less crazy, but still pretty unusable. I think part of the issue is the way the pen works; small strokes seem to be equivalent to a quick mouse movement. I'd look through the code base, but I don't know it very well to look for issues like this. :( I doubt this is a Wacom specific issue and is probably problematic for any other tablet brands. Anyway, for me, I feel that using a tablet in a game engine isn't ideal - I typically create assets outside of the engine, once they are imported in, I switch to mouse and keyboard.

Sparkezel commented 11 months ago

Found a solution to this issue, you have to enable "Allow for using pen as a mouse in some classic apps" obraz I had the same problem myself, on my xp-pen artist pro 15.6. I used to edit polygon UVs on my tablet as it felt much better than inputting with my mouse there so I was quite surprised that in 4.1.3 it didn't work. Thankfully there seems to be some sort of solution for that on windows.

MatthijsMud commented 2 months ago

This issue does not seem to be limited to the editor. While looking at the examples of Phantom camera I ran into the issue that the 3rd person camera also goes haywire. As there is less code involved compared to Godot's editor it was somewhat easier to find the "cause": the value of InputEventMouseMotion.relative behaves strange when Input.MOUSE_MODE_CAPTURED is in effect.

The following would demonstrate the issue when using drawing tablet as point device (Wacom PTK640 in my case).

extends Node

func _input(event):
    if event is InputEventMouseMotion:
        print(event.relative)
        return
    if event is InputEventKey:
        if event.pressed && event.keycode == KEY_SPACE:
            if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
                Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
            else:
                Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

While moving the pen you'd normally get values that correspond to the movement. If the mouse has been captured however, the "relative" value seems to based on the distance from the center of the viewport (clipped to viewport_* / 2). In case of a maximized window it would roughly correspond to the following schematic:

Wacom

Calinou commented 2 months ago

@MatthijsMud Please open a separate issue for that, as this is an unrelated issue. See also https://github.com/godotengine/godot/issues/38290.

I don't think captured mouse mode was tested extensively with pen input. Some games support it well but I assume you're supposed to change some system-wide setting, so that the pen input is considered relative instead of absolute. It may be possible to do this automatically on Godot's end when using captured mouse mode, but I don't know how.

MatthijsMud commented 2 months ago

@Calinou To me it seems like it is a different symptom of the same underlying issue.

  1. In the viewport, right-clicking with the pen causes viewport to go crazy: view starts to orbit uncontrollably. While using regular mouse, you can orbit the view with ease.

The "look" navigation in the 3D viewport is implemented using InputEventMouseMotion.relative. When using the cursor's position relative to the center of the screen, rather than its position during the previous "frame", you get values in the range of -960 to +960 each frame (on a 1920/1080 monitor).

My tablet has a working area of roughly 23 × 14 cm (10 × 5.5 inch). At 1 cm (0.4 inch) from the center you get about 80° worth of rotation per movement event. Minuscule movements of the pen trigger movement events; I get about 15/s while trying to keep the pen still. That would results in just over 3 full rotations of the camera in one second. Increase the distance from the center and it starts spinning even faster.

Now I don't know where to draw the line for "spinning uncontrollable", but I feel 2/s would already be pushing it. Which makes it so only about 0.16% of the tablet's area can be used for comfortably controlling the camera

https://github.com/godotengine/godot/blob/a7a124a57d643103c882a781dfe1f3772363ecc7/editor/plugins/node_3d_editor_plugin.cpp#L2136

https://github.com/godotengine/godot/blob/a7a124a57d643103c882a781dfe1f3772363ecc7/editor/plugins/node_3d_editor_plugin.cpp#L2638-L2646

https://github.com/godotengine/godot/blob/a7a124a57d643103c882a781dfe1f3772363ecc7/editor/plugins/node_3d_editor_plugin.cpp#L2537-L2545


2. While using mouse: you can change object values, like position or scale, by left-clicking on the value and sliding left or right. The value will change steadily based on your movement. If you try to do the same with wacom pen, the value starts to increase rapidly, whether you move cursor left or right.

The "spin slider" is similarly implemented using .relative. By default those sliders tend to appear on the right side of the screen, where you'd get numbers near the high end each movement. So the number would rapidly increase while the cursor is near the slider. I'm guessing most people would generally keep the cursor near the slider; moving the pen to the other side of the tablet causes the numbers to drop quickly.

https://github.com/godotengine/godot/blob/a7a124a57d643103c882a781dfe1f3772363ecc7/editor/gui/editor_spin_slider.cpp#L94-L98

aristides86 commented 2 months ago

I would gladly send some pen tablets to the devs for free if it means they finally implement this thing. Artists don't use mice, it's driving me nuts.

mbrlabs commented 4 weeks ago

I'm not sure if this is the same issue i experienced here, but for me it worked to change the tablet driver in Godot's project settings from winink to wintab. I'm not sure if there is such a setting for the editor though. It might work with a CLI argument when launching the edior.

Like this: godot.exe --tablet-driver wintab /path/to/project.godot