Post #2212: ![](https://blenderartists.org/user_avatar/blenderartists.org/blenderbob/48/7806

πŸ“‹ Metadata

  • Author: roaoao
  • Date: 2019-04-25 07:18:35
  • Type: answer
  • Quality Score: 7/10
  • Reply to: post_02211

🏷️ Tags

macro hotkeys intermediate solved

  • Macro Editor
  • Python Scripting

πŸ’¬ Content

BlenderBob:

I found what the problem is. If I drag to select the vertex, even if I only pick one, it won’t work. If I just select one vertex, then it’s ok.

Try this code instead:

bpy.ops.view3d.snap_cursor_to_selected(); bpy.ops.object.mode_set(mode='OBJECT'); bpy.ops.object.origin_set(type='ORIGIN_CURSOR'); bpy.ops.object.mode_set(mode='EDIT')

πŸ”— View on Blender Artists