Page MenuHome

Gizmo.modal(): current value '20514' matches no enum in 'Event', '(null)', 'type'
Closed, ResolvedPublicBUG

Description

Blender Version
Broken: all versions up to this point

Short description of error
Whenever a Shift or a Ctrl key is pressed/released during a modal gizmo operation, event.type returns an empty string and the following warning is printed to the console:

WARN (bpy.rna): c:\b\win64_cmake_vs2017\win64_cmake_vs2017\blender.git\source\blender\python\intern\bpy_rna.c:1476 pyrna_enum_to_py: current value '20514' matches no enum in 'Event', '(null)', 'type'

Note: this warning is not printed if the script does not try to access event.type from a gizmo's modal() method.

Exact steps for others to reproduce the error

  1. Go to the "Scripting" workspace
  2. In the text editor area, load a "Gizmo Custom Geometry" python template (Templates -> Python -> Gizmo Custom Geometry)
  3. Add to the modal() method any code that accesses event.type (e.g. print(event.type))
  4. Run the script
  5. In the 3D view, tap / press / release the Shift or Ctrl keys while dragging the gizmo

Event Timeline

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Tue, Feb 11, 1:43 PM

Can confirm.
Looks like value 20514 is type EVT_MODAL_MAP, not sure why RNA_property_enum_identifier is not picking that up, checking...

Hm, not too familiar with wmEvent.type, but it looks like not all event types (defined in wm_event_types.h) are in the enum (iterating with RNA_enum_from_value).
This might be for @Campbell Barton (campbellbarton) or @Julian Eisel (Severin) to have a look at...

Campbell Barton (campbellbarton) changed the subtype of this task from "Report" to "Bug".Wed, Feb 12, 7:31 AM