W.I.P. multi-touch addon (Intuos/Windows only)

I’m working on an Python-only addon to support multi-touch for Wacom Intuos PTH-651 for Blender 2.9 on Windows 10.

It uses the WacomMT API. The addon uses ctypes to recreate the data structures, and register a callback function to read finger data.

This data is not fed into Blender’s event loop. Instead, I’m testing with a custom modal operator that is triggered at 100Hz from Blender’s own window manager. 100Hz is the frequency the Intuos uses.

The finger-reading callback Python function gets called by a different thread spawned by the tabled driver. From the callback, I push such data into a thread-safe queue. The modal operator pulls data from the queue every 10ms.

At this point, the operator can to what it please with the scene. Here is a video of a very short test (YouTube). In this, I’m modifying the pose rotation of last bone only when two fingers are detected.

4 Likes

The test operator now can move and rotate the current pose bone. I’ve posted another short video in YouTube. The IK modifier is on the middle bone.

In this video, the operator timer is set to 100Hz. In the previous one, it was left to 15Hz (or 30Hz, don’t remember).

The tablet lays on a desk book stand right in front of the monitor, so they are both in focus. The video has also been 2D stabilized with Blender.

The Python callback now moves finger data by a memmove out of the memory allocated by the tablet driver. The destination is a ctypes array, which is allocated on according to the variable number of fingers detected by the tablet. Some memory leaks and corruption are now fixed.

Overall, it feels now faster. The instance of Blender you see is compiled in debug mode and running with some debugging flags, so it should be slower than usual.

The finger numbers you see are simple text drawn in the post pixel phase. “1” is tracking my thumb, “2” is my index finger. The numbers are the order in which the fingers are detected.

1 Like

with pressure sensitivity one could move a object up and down
while XY are done with touch center point.