Page MenuHome

DOUBLE_CLICK type not being recognized within modal operation
Open, Needs Triage by DeveloperPublic

Description

System Information
Operating system: Windows-8.1-6.3.9600 64 Bits
Graphics card: GeForce GTX 1660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.39

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
When trying to work in some custom actions through a modal to recognize a Double Click event type, the action is not recognized. I have tried raising and lowering the double click timing in preferences, but nothing seems to work.

Exact steps for others to reproduce the error
This script checks for type DOUBLE_CLICK first, and then posts a RELEASE type to verify it passed through with LEFTMOUSE.

I'm newish to Blender but not to Python. Apologies if I missed something in this setup, but it seems pretty straightforward.

import bpy

class ModalTimerOperator(bpy.types.Operator):

"""Operator which runs its self from a timer"""
bl_idname = "wm.modal_timer_operator"
bl_label = "Modal Timer Operator"

_timer = None

def modal(self, context, event):
    if event.type in {'LEFTMOUSE'}:
        if event.value in {'DOUBLE_CLICK'}:
            print('DOUBLE CLICK')
        elif event.value in {'RELEASE'}:
            print('RELEASE')
        return {'RUNNING_MODAL'}

    if event.type in {'ESC'}:
        self.cancel(context)
        return {'CANCELLED'}

    if event.type == 'TIMER':
        pass

    return {'PASS_THROUGH'}

def execute(self, context):
    wm = context.window_manager
    self._timer = wm.event_timer_add(1, window = context.window)
    wm.modal_handler_add(self)
    return {'RUNNING_MODAL'}

def cancel(self, context):
    wm = context.window_manager
    wm.event_timer_remove(self._timer)

def register():

bpy.utils.register_class(ModalTimerOperator)

def unregister():

bpy.utils.unregister_class(ModalTimerOperator)

if name == "main":

register()
# test call
bpy.ops.wm.modal_timer_operator('INVOKE_DEFAULT')

Details

Type
Bug

Event Timeline