# How to set origin to selected vertex for 2D shapes (fast) ? (blender 2.8 +)

is there a way to set the origin to selected vertex faster? (for both shapes and objects) there are a lot of steps to do it right now and it's frustrating.

I found a similar topic but it's old and not working with blender 2.8 2.9 and ... . an addon similar to this topic would be great. Shortcut for setting origin to vertex

• AFAIC the addon linked to blender.stackexchange.com/a/134460/15543 does exactly this (written for 2.8, tested on 2.91). – batFINGER Dec 17 '20 at 14:53
• thanks but it's not working with 2D shapes origin. – Pooya heydari Dec 17 '20 at 23:27
• – lemon Dec 19 '20 at 13:49

You can activate the "3D Viewport Pie Menus" vanilla addon, there is a checkbox to enable "Origin Pie Menu" in its preferences. Once activated, you can select a vertex/edge/face in Edit mode and with the shortcut choose to move origin to selection.

For curve objects: when you are in Edit mode, select a vertex, then in the Search menu search for the Origin to selection.

Move grease pencil origin to average of selection in edit mode.

_Note have not converted to operator or added shortcut, have simply pasted scripts into text editor and run via "Run Script" (play button).

I'm assuming by 2D shape you are referring to a grease pencil object. The equivalent of method shown in https://blender.stackexchange.com/a/134460/15543 using GP is

import bpy
from mathutils import Vector
from bpy import context

ob = context.object
mw = ob.matrix_world

gp = ob.data
active_layer = gp.layers.active
active_frame = active_layer.active_frame
selected_points = [
p for layer in gp.layers
for frame in layer.frames
for stroke in frame.strokes
for p in stroke.points
if p.select
]
if selected_points:
cl = sum([p.co for p in selected_points], Vector()) / len(selected_points)
for layer in gp.layers:
for frame in layer.frames:
for stroke in frame.strokes:
for p in stroke.points:

p.co -= cl

ob.matrix_world.translation = mw @ cl


Move grease pencil origin to 3D cursor loc in edit mode.

import bpy
from mathutils import Vector
from bpy import context

ob = context.object
mw = ob.matrix_world

scene = context.scene
cl = mw.inverted() @ scene.cursor.location
gp = ob.data
active_layer = gp.layers.active
active_frame = active_layer.active_frame
for layer in gp.layers:
for frame in layer.frames:
for stroke in frame.strokes:
for p in stroke.points:

p.co -= cl

ob.matrix_world.translation = scene.cursor.location

• thanks for your time,i mean 2D curves,(in 3dsMax we use word SHAPE). – Pooya heydari Dec 19 '20 at 8:19
• i've edited the "top answer" to be more accurate answer. – Pooya heydari Dec 19 '20 at 8:28
• I see you have removed your comment doesn't work for 2D shapes there too. Please instead edit your own question using blender terminology like "2D curve" and "Control point" not vertex. – batFINGER Dec 19 '20 at 8:36
• ok,sorry for that,and thank you. – Pooya heydari Dec 19 '20 at 15:06