tablet mouse mousemove events are firing when should not #91325

Open
opened 2021-09-10 22:21:47 +02:00 by Jakub Uhlik · 6 comments

System Information
Operating system: macOS-10.13.6-x86_64-i386-64bit 64 Bits

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-09-06 16:56, hash: d7d8eb7de4
Worked: not tested

Short description of error
tablet mouse mousemove events are firing when should not

Exact steps for others to reproduce the error
tablet mouse mousemove events are firing when should not, i.e. when pen is pressed down, not moving, at full force to max out pressure and holding with both hands to prevent tilting (and verifying by numbers that it is). to repeat have a wacom, run code, watch terminal, press pen on tablet and prevent it moving. with regular mouse mouse move events are not firing when mouse is not moved so i think tablet pen when is not moved, its pressure or tilt is not changed should behave the same..

import bpy
from mathutils import Vector


class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"
    
    def modal(self, context, event):
        if(event.type == 'MOUSEMOVE'):
            if(event.is_tablet):
                print(event.type, event.mouse_x, event.mouse_y, event.pressure, event.tilt.x, event.tilt.y, )
                if(self.mouse_x == event.mouse_x and self.mouse_y == event.mouse_y and event.tilt == self.tilt and event.pressure == self.pressure):
                    #
                    - should not fire mouse move event while everything is the same? like with regular mouse..
                    #
                    print("!" * 100)
                else:
                    print(".")
                
                self.tilt = event.tilt
                self.pressure = event.pressure
                self.mouse_x = event.mouse_x
                self.mouse_y = event.mouse_y
        
        elif(event.type in {'ESC', }):
            return {'CANCELLED'}
        
        return {'RUNNING_MODAL'}
    
    def invoke(self, context, event):
        self.mouse_x = 0.0
        self.mouse_y = 0.0
        self.pressure = 1.0
        self.tilt = Vector()
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}


def register():
    bpy.utils.register_class(ModalOperator)


def unregister():
    bpy.utils.unregister_class(ModalOperator)


if __name__ == "__main__":
    register()
    
    # test call
    bpy.ops.object.modal_operator('INVOKE_DEFAULT')

**System Information** Operating system: macOS-10.13.6-x86_64-i386-64bit 64 Bits **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-09-06 16:56, hash: `d7d8eb7de4` Worked: not tested **Short description of error** tablet mouse mousemove events are firing when should not **Exact steps for others to reproduce the error** tablet mouse mousemove events are firing when should not, i.e. when pen is pressed down, not moving, at full force to max out pressure and holding with both hands to prevent tilting (and verifying by numbers that it is). to repeat have a wacom, run code, watch terminal, press pen on tablet and prevent it moving. with regular mouse mouse move events are not firing when mouse is not moved so i think tablet pen when is not moved, its pressure or tilt is not changed should behave the same.. ``` import bpy from mathutils import Vector class ModalOperator(bpy.types.Operator): bl_idname = "object.modal_operator" bl_label = "Simple Modal Operator" def modal(self, context, event): if(event.type == 'MOUSEMOVE'): if(event.is_tablet): print(event.type, event.mouse_x, event.mouse_y, event.pressure, event.tilt.x, event.tilt.y, ) if(self.mouse_x == event.mouse_x and self.mouse_y == event.mouse_y and event.tilt == self.tilt and event.pressure == self.pressure): # - should not fire mouse move event while everything is the same? like with regular mouse.. # print("!" * 100) else: print(".") self.tilt = event.tilt self.pressure = event.pressure self.mouse_x = event.mouse_x self.mouse_y = event.mouse_y elif(event.type in {'ESC', }): return {'CANCELLED'} return {'RUNNING_MODAL'} def invoke(self, context, event): self.mouse_x = 0.0 self.mouse_y = 0.0 self.pressure = 1.0 self.tilt = Vector() context.window_manager.modal_handler_add(self) return {'RUNNING_MODAL'} def register(): bpy.utils.register_class(ModalOperator) def unregister(): bpy.utils.unregister_class(ModalOperator) if __name__ == "__main__": register() # test call bpy.ops.object.modal_operator('INVOKE_DEFAULT') ```
Author

Added subscriber: @JakubUhlik

Added subscriber: @JakubUhlik

Added subscriber: @jenkm

Added subscriber: @jenkm

Not sure how you detect that the pen is not moving. There may be tiny movements, less than a pixel.
You can easily have a series of events with the same coordinates. I'm able to get it with both a mouse and a trackpad.

Not sure how you detect that the pen is not moving. There may be tiny movements, less than a pixel. You can easily have a series of events with the same coordinates. I'm able to get it with both a mouse and a trackpad.
Author

it is not a problem of coordinates, but that the event is firing, no change should be no event i guess. another test, i took myself from equation, made L from boxes, put pen in corner, nothing moved, no change in pressure, no change in tilt, many many events firing constantly. would be nice if somebody can replicate that with maybe less well used tablet. mine might be faulty after years of use..

it is not a problem of coordinates, but that the event is firing, no change should be no event i guess. another test, i took myself from equation, made L from boxes, put pen in corner, nothing moved, no change in pressure, no change in tilt, many many events firing constantly. would be nice if somebody can replicate that with maybe less well used tablet. mine might be faulty after years of use..

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Yeah, I see what you mean, checked with Wacom CTL-4100. But it seems to me this is the expected behavior, the driver fire events with a certain frequency, events can be identical. And I don't see any problems with drawing or sculpting modes.

Definitely not related to the "Python API", maybe someone from the "User Interface" team will explain how it should be.

Yeah, I see what you mean, checked with Wacom CTL-4100. But it seems to me this is the expected behavior, the driver fire events with a certain frequency, events can be identical. And I don't see any problems with drawing or sculpting modes. Definitely not related to the "Python API", maybe someone from the "User Interface" team will explain how it should be.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:23:11 +01:00
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
2 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#91325
No description provided.