Post #1874: Ja

๐Ÿ“‹ Metadata

๐Ÿท๏ธ Tags

macro hotkeys intermediate solved

  • Macro Editor
  • Python Scripting
  • tag_redraw() function

๐Ÿ’ฌ Content

Jakro:

the viewport doesnโ€™t update when I switch between vert,edge,face via a mode selector

Hmm, looks like itโ€™s a Blender issue.
You can update the viewport manually by using PMEโ€™s tag_redraw() or tag_redraw(area='VIEW_3D', region='WINDOW') function:

bpy.ops.object.mode_set(mode='EDIT'); bpy.ops.wm.context_set_value(data_path="tool_settings.mesh_select_mode", value= "(False, False, True)"); tag_redraw(area='VIEW_3D', region='WINDOW')

Btw, you can use this code instead:

bpy.ops.object.mode_set(mode='EDIT'); C.tool_settings.mesh_select_mode = (False, False, True); tag_redraw(area='VIEW_3D', region='WINDOW')

โค๏ธ 3 likes


๐Ÿ”— View on Blender Artists