Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NKO55 opened this issue Apr 25, 2023 · 12 comments
Open

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

NKO55 opened this issue Apr 25, 2023 · 12 comments

Comments

@NKO55
Copy link

NKO55 commented Apr 25, 2023

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
Copy link
Contributor

capnm commented Apr 25, 2023

See #75903 (comment) , switching the tablet to relative mode might help.

@Calinou
Copy link
Member

Calinou commented Apr 25, 2023

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.

@capnm
Copy link
Contributor

capnm commented Apr 26, 2023

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
Copy link
Author

NKO55 commented Apr 26, 2023

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
Copy link

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
Copy link

Sparkezel commented Nov 30, 2023

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
Copy link

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
Copy link
Member

Calinou commented Aug 12, 2024

@MatthijsMud Please open a separate issue for that, as this is an unrelated issue. See also #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
Copy link

@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

_nav_look(m, _get_warped_mouse_motion(m));

Point2 Node3DEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
Point2 relative;
if (bool(EDITOR_GET("editors/3d/navigation/warped_mouse_panning"))) {
relative = Input::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect());
} else {
relative = p_ev_mouse_motion->get_relative();
}
return relative;
}

if (invert_y_axis) {
cursor.x_rot -= p_relative.y * radians_per_pixel;
} else {
cursor.x_rot += p_relative.y * radians_per_pixel;
}
// Clamp the Y rotation to roughly -90..90 degrees so the user can't look upside-down and end up disoriented.
cursor.x_rot = CLAMP(cursor.x_rot, -1.57, 1.57);
cursor.y_rot += p_relative.x * radians_per_pixel;


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.

double diff_x = mm->get_relative().x;
if (mm->is_shift_pressed() && grabbing_spinner) {
diff_x *= 0.1;
}
grabbing_spinner_dist_cache += diff_x * grabbing_spinner_speed;

@aristides86
Copy link

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
Copy link
Contributor

mbrlabs commented Sep 27, 2024

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

@Calinou
Copy link
Member

Calinou commented Nov 3, 2024

@bruvzg Should we add an editor setting to provide a tablet driver option that's independent from the project setting?

It could have the values "Project Default", winink and wintab. The setting would only have an effect on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants