0
$\begingroup$

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

thanks for your time.

$\endgroup$
3
3
$\begingroup$

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.

enter image description here

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

enter image description here

$\endgroup$
0
2
$\begingroup$

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).

enter image description here

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
$\endgroup$
4
  • $\begingroup$ thanks for your time,i mean 2D curves,(in 3dsMax we use word SHAPE). $\endgroup$ – Pooya heydari Dec 19 '20 at 8:19
  • $\begingroup$ i've edited the "top answer" to be more accurate answer. $\endgroup$ – Pooya heydari Dec 19 '20 at 8:28
  • $\begingroup$ 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. $\endgroup$ – batFINGER Dec 19 '20 at 8:36
  • $\begingroup$ ok,sorry for that,and thank you. $\endgroup$ – Pooya heydari Dec 19 '20 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.