Shortcut for setting origin to vertex The Next CEO of Stack OverflowSet origin to vertex in...

What was the first Unix version to run on a microcomputer?

What does "Its cash flow is deeply negative" mean?

WOW air has ceased operation, can I get my tickets refunded?

Won the lottery - how do I keep the money?

Interfacing a button to MCU (and PC) with 50m long cable

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

How to start emacs in "nothing" mode (`fundamental-mode`)

Geometry problem - areas of triangles (contest math)

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

How to count occurrences of text in a file?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

Do I need to enable Dev Hub in my PROD Org?

How did people program for Consoles with multiple CPUs?

Indicator light circuit

How long to clear the 'suck zone' of a turbofan after start is initiated?

What is the result of assigning to std::vector<T>::begin()?

What can we do to stop prior company from asking us questions?

Why do variable in an inner function return nan when there is the same variable name at the inner function declared after log

Is 'diverse range' a pleonastic phrase?

Is it possible to search for a directory/file combination?

What happened in Rome, when the western empire "fell"?

MessageLevel in QGIS3

How did the Bene Gesserit know how to make a Kwisatz Haderach?



Shortcut for setting origin to vertex



The Next CEO of Stack OverflowSet origin to vertex in edit mode?Left MB Click is setting the origin of the object“Cursor to selected” does not go to the center of selected verticesMove the origin point to the cursor in Edit ModeLock object origin to 3D cursorHow to add another option to set object origin hotkeyWhy does the object change its location after setting origin?Messed up origin pointCan't remove keyboard shortcut for vertex paintSet up shortcut for object interaction modeChanging an objects origin just changes its location












5












$begingroup$


I find myself doing the following quite often:




  1. go into edit mode

  2. select a single vertex

  3. press Space to enter the search menu

  4. type cur


  5. select Set cursor to active



    Set cursor to active



  6. leave edit mode

  7. press Shift+Ctrl+Alt+C to get the set origin choices


  8. Choose Set origin to 3D cursor



    Set origin to 3D cursor




This seems like a very tedious process to me. I'm sure there's a shorter version of setting the origin to a vertex. Please tell me how to make this process more efficient.



I am open to installing an Addon if necessary.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    OK, but I hope somebody will give a more complete answer, because i do this steps quite often too and a way to automate it would be handy.
    $endgroup$
    – thibsert
    Mar 16 at 12:29










  • $begingroup$
    I don't think there is any built-in way as of 2.79. There were talks it will be In 2.8. With addons it can be made faster, like with Dynamic Context menu (built-in one), see blender.stackexchange.com/a/71319/1245. There are also some 3-rd party addons as well though their workable state is to be checked
    $endgroup$
    – Mr Zak
    Mar 16 at 12:55






  • 1




    $begingroup$
    Related: blender.meta.stackexchange.com/questions/2387/…
    $endgroup$
    – batFINGER
    Mar 16 at 17:43










  • $begingroup$
    lol, don't be sorry.. I love that question (and especially the deleted answer) it appeals to my warped SOH. Post it whenever I'm given the opportunity.
    $endgroup$
    – batFINGER
    Mar 16 at 19:08
















5












$begingroup$


I find myself doing the following quite often:




  1. go into edit mode

  2. select a single vertex

  3. press Space to enter the search menu

  4. type cur


  5. select Set cursor to active



    Set cursor to active



  6. leave edit mode

  7. press Shift+Ctrl+Alt+C to get the set origin choices


  8. Choose Set origin to 3D cursor



    Set origin to 3D cursor




This seems like a very tedious process to me. I'm sure there's a shorter version of setting the origin to a vertex. Please tell me how to make this process more efficient.



I am open to installing an Addon if necessary.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    OK, but I hope somebody will give a more complete answer, because i do this steps quite often too and a way to automate it would be handy.
    $endgroup$
    – thibsert
    Mar 16 at 12:29










  • $begingroup$
    I don't think there is any built-in way as of 2.79. There were talks it will be In 2.8. With addons it can be made faster, like with Dynamic Context menu (built-in one), see blender.stackexchange.com/a/71319/1245. There are also some 3-rd party addons as well though their workable state is to be checked
    $endgroup$
    – Mr Zak
    Mar 16 at 12:55






  • 1




    $begingroup$
    Related: blender.meta.stackexchange.com/questions/2387/…
    $endgroup$
    – batFINGER
    Mar 16 at 17:43










  • $begingroup$
    lol, don't be sorry.. I love that question (and especially the deleted answer) it appeals to my warped SOH. Post it whenever I'm given the opportunity.
    $endgroup$
    – batFINGER
    Mar 16 at 19:08














5












5








5


1



$begingroup$


I find myself doing the following quite often:




  1. go into edit mode

  2. select a single vertex

  3. press Space to enter the search menu

  4. type cur


  5. select Set cursor to active



    Set cursor to active



  6. leave edit mode

  7. press Shift+Ctrl+Alt+C to get the set origin choices


  8. Choose Set origin to 3D cursor



    Set origin to 3D cursor




This seems like a very tedious process to me. I'm sure there's a shorter version of setting the origin to a vertex. Please tell me how to make this process more efficient.



I am open to installing an Addon if necessary.










share|improve this question











$endgroup$




I find myself doing the following quite often:




  1. go into edit mode

  2. select a single vertex

  3. press Space to enter the search menu

  4. type cur


  5. select Set cursor to active



    Set cursor to active



  6. leave edit mode

  7. press Shift+Ctrl+Alt+C to get the set origin choices


  8. Choose Set origin to 3D cursor



    Set origin to 3D cursor




This seems like a very tedious process to me. I'm sure there's a shorter version of setting the origin to a vertex. Please tell me how to make this process more efficient.



I am open to installing an Addon if necessary.







shortcut 3d-cursor origin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 16 at 18:48







Thomas Weller

















asked Mar 16 at 11:56









Thomas WellerThomas Weller

656617




656617








  • 2




    $begingroup$
    OK, but I hope somebody will give a more complete answer, because i do this steps quite often too and a way to automate it would be handy.
    $endgroup$
    – thibsert
    Mar 16 at 12:29










  • $begingroup$
    I don't think there is any built-in way as of 2.79. There were talks it will be In 2.8. With addons it can be made faster, like with Dynamic Context menu (built-in one), see blender.stackexchange.com/a/71319/1245. There are also some 3-rd party addons as well though their workable state is to be checked
    $endgroup$
    – Mr Zak
    Mar 16 at 12:55






  • 1




    $begingroup$
    Related: blender.meta.stackexchange.com/questions/2387/…
    $endgroup$
    – batFINGER
    Mar 16 at 17:43










  • $begingroup$
    lol, don't be sorry.. I love that question (and especially the deleted answer) it appeals to my warped SOH. Post it whenever I'm given the opportunity.
    $endgroup$
    – batFINGER
    Mar 16 at 19:08














  • 2




    $begingroup$
    OK, but I hope somebody will give a more complete answer, because i do this steps quite often too and a way to automate it would be handy.
    $endgroup$
    – thibsert
    Mar 16 at 12:29










  • $begingroup$
    I don't think there is any built-in way as of 2.79. There were talks it will be In 2.8. With addons it can be made faster, like with Dynamic Context menu (built-in one), see blender.stackexchange.com/a/71319/1245. There are also some 3-rd party addons as well though their workable state is to be checked
    $endgroup$
    – Mr Zak
    Mar 16 at 12:55






  • 1




    $begingroup$
    Related: blender.meta.stackexchange.com/questions/2387/…
    $endgroup$
    – batFINGER
    Mar 16 at 17:43










  • $begingroup$
    lol, don't be sorry.. I love that question (and especially the deleted answer) it appeals to my warped SOH. Post it whenever I'm given the opportunity.
    $endgroup$
    – batFINGER
    Mar 16 at 19:08








2




2




$begingroup$
OK, but I hope somebody will give a more complete answer, because i do this steps quite often too and a way to automate it would be handy.
$endgroup$
– thibsert
Mar 16 at 12:29




$begingroup$
OK, but I hope somebody will give a more complete answer, because i do this steps quite often too and a way to automate it would be handy.
$endgroup$
– thibsert
Mar 16 at 12:29












$begingroup$
I don't think there is any built-in way as of 2.79. There were talks it will be In 2.8. With addons it can be made faster, like with Dynamic Context menu (built-in one), see blender.stackexchange.com/a/71319/1245. There are also some 3-rd party addons as well though their workable state is to be checked
$endgroup$
– Mr Zak
Mar 16 at 12:55




$begingroup$
I don't think there is any built-in way as of 2.79. There were talks it will be In 2.8. With addons it can be made faster, like with Dynamic Context menu (built-in one), see blender.stackexchange.com/a/71319/1245. There are also some 3-rd party addons as well though their workable state is to be checked
$endgroup$
– Mr Zak
Mar 16 at 12:55




1




1




$begingroup$
Related: blender.meta.stackexchange.com/questions/2387/…
$endgroup$
– batFINGER
Mar 16 at 17:43




$begingroup$
Related: blender.meta.stackexchange.com/questions/2387/…
$endgroup$
– batFINGER
Mar 16 at 17:43












$begingroup$
lol, don't be sorry.. I love that question (and especially the deleted answer) it appeals to my warped SOH. Post it whenever I'm given the opportunity.
$endgroup$
– batFINGER
Mar 16 at 19:08




$begingroup$
lol, don't be sorry.. I love that question (and especially the deleted answer) it appeals to my warped SOH. Post it whenever I'm given the opportunity.
$endgroup$
– batFINGER
Mar 16 at 19:08










2 Answers
2






active

oldest

votes


















6












$begingroup$

Steps 3/4/5 can be replaced by Shift+S (for Snapping) / O.



Step 8 can be replaced by T. In general, you can look for underlined letters in such menus.



I also wrote an add-on to automate the process: OriginToSelection.py.



Install the add-on via User Preferences / Add-ons / Install from file, don't forget to activate it (check the box before its name). Press Spacebar and search Origin, then select Origin To Selection.



Be careful, I'm new to publishing add-ons and I'm pretty sure it can cause crashes. Save your work before using!






share|improve this answer











$endgroup$













  • $begingroup$
    The plugin is cool. Works fine so far.
    $endgroup$
    – Thomas Weller
    Mar 16 at 13:30










  • $begingroup$
    It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
    $endgroup$
    – thibsert
    Mar 16 at 13:39










  • $begingroup$
    I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
    $endgroup$
    – batFINGER
    Mar 16 at 15:29










  • $begingroup$
    I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
    $endgroup$
    – thibsert
    Mar 16 at 15:35












  • $begingroup$
    Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
    $endgroup$
    – batFINGER
    Mar 16 at 19:32



















3












$begingroup$

Little bmesh helper script.



The process to move the origin involves making the new point the origin by subtracting it from all other verts, then translating the matrix world of the object such that the global location stays the same



Run in edit mode. Moves origin to selected geo.



import bpy
import bmesh
from mathutils import Vector
context = bpy.context

ob = context.edit_object
mw = ob.matrix_world
me = ob.data
bm = bmesh.from_edit_mesh(me)

selverts = [v.co for v in bm.verts if v.select]
if len(selverts):
pt = sum(selverts, Vector()) / len(selverts)
#T = Matrix.Translation(-pt)
bmesh.ops.translate(bm, vec=-pt, verts=bm.verts)
mw.translation = mw @ pt # replace @ with * for 2.7x
bmesh.update_edit_mesh(me)


As an addon for 2.80



enter image description here






share|improve this answer











$endgroup$













  • $begingroup$
    does it work for blender 2.78a,2.79?
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:13






  • 1




    $begingroup$
    Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
    $endgroup$
    – batFINGER
    Mar 16 at 19:16












  • $begingroup$
    well anyways the other addon works for me too
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:19






  • 1




    $begingroup$
    Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
    $endgroup$
    – batFINGER
    Mar 16 at 19:24








  • 1




    $begingroup$
    This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
    $endgroup$
    – thibsert
    Mar 16 at 23:02












Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "502"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f134440%2fshortcut-for-setting-origin-to-vertex%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









6












$begingroup$

Steps 3/4/5 can be replaced by Shift+S (for Snapping) / O.



Step 8 can be replaced by T. In general, you can look for underlined letters in such menus.



I also wrote an add-on to automate the process: OriginToSelection.py.



Install the add-on via User Preferences / Add-ons / Install from file, don't forget to activate it (check the box before its name). Press Spacebar and search Origin, then select Origin To Selection.



Be careful, I'm new to publishing add-ons and I'm pretty sure it can cause crashes. Save your work before using!






share|improve this answer











$endgroup$













  • $begingroup$
    The plugin is cool. Works fine so far.
    $endgroup$
    – Thomas Weller
    Mar 16 at 13:30










  • $begingroup$
    It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
    $endgroup$
    – thibsert
    Mar 16 at 13:39










  • $begingroup$
    I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
    $endgroup$
    – batFINGER
    Mar 16 at 15:29










  • $begingroup$
    I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
    $endgroup$
    – thibsert
    Mar 16 at 15:35












  • $begingroup$
    Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
    $endgroup$
    – batFINGER
    Mar 16 at 19:32
















6












$begingroup$

Steps 3/4/5 can be replaced by Shift+S (for Snapping) / O.



Step 8 can be replaced by T. In general, you can look for underlined letters in such menus.



I also wrote an add-on to automate the process: OriginToSelection.py.



Install the add-on via User Preferences / Add-ons / Install from file, don't forget to activate it (check the box before its name). Press Spacebar and search Origin, then select Origin To Selection.



Be careful, I'm new to publishing add-ons and I'm pretty sure it can cause crashes. Save your work before using!






share|improve this answer











$endgroup$













  • $begingroup$
    The plugin is cool. Works fine so far.
    $endgroup$
    – Thomas Weller
    Mar 16 at 13:30










  • $begingroup$
    It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
    $endgroup$
    – thibsert
    Mar 16 at 13:39










  • $begingroup$
    I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
    $endgroup$
    – batFINGER
    Mar 16 at 15:29










  • $begingroup$
    I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
    $endgroup$
    – thibsert
    Mar 16 at 15:35












  • $begingroup$
    Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
    $endgroup$
    – batFINGER
    Mar 16 at 19:32














6












6








6





$begingroup$

Steps 3/4/5 can be replaced by Shift+S (for Snapping) / O.



Step 8 can be replaced by T. In general, you can look for underlined letters in such menus.



I also wrote an add-on to automate the process: OriginToSelection.py.



Install the add-on via User Preferences / Add-ons / Install from file, don't forget to activate it (check the box before its name). Press Spacebar and search Origin, then select Origin To Selection.



Be careful, I'm new to publishing add-ons and I'm pretty sure it can cause crashes. Save your work before using!






share|improve this answer











$endgroup$



Steps 3/4/5 can be replaced by Shift+S (for Snapping) / O.



Step 8 can be replaced by T. In general, you can look for underlined letters in such menus.



I also wrote an add-on to automate the process: OriginToSelection.py.



Install the add-on via User Preferences / Add-ons / Install from file, don't forget to activate it (check the box before its name). Press Spacebar and search Origin, then select Origin To Selection.



Be careful, I'm new to publishing add-ons and I'm pretty sure it can cause crashes. Save your work before using!







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 17 at 1:58









Community

1




1










answered Mar 16 at 12:26









thibsertthibsert

2,0441311




2,0441311












  • $begingroup$
    The plugin is cool. Works fine so far.
    $endgroup$
    – Thomas Weller
    Mar 16 at 13:30










  • $begingroup$
    It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
    $endgroup$
    – thibsert
    Mar 16 at 13:39










  • $begingroup$
    I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
    $endgroup$
    – batFINGER
    Mar 16 at 15:29










  • $begingroup$
    I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
    $endgroup$
    – thibsert
    Mar 16 at 15:35












  • $begingroup$
    Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
    $endgroup$
    – batFINGER
    Mar 16 at 19:32


















  • $begingroup$
    The plugin is cool. Works fine so far.
    $endgroup$
    – Thomas Weller
    Mar 16 at 13:30










  • $begingroup$
    It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
    $endgroup$
    – thibsert
    Mar 16 at 13:39










  • $begingroup$
    I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
    $endgroup$
    – batFINGER
    Mar 16 at 15:29










  • $begingroup$
    I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
    $endgroup$
    – thibsert
    Mar 16 at 15:35












  • $begingroup$
    Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
    $endgroup$
    – batFINGER
    Mar 16 at 19:32
















$begingroup$
The plugin is cool. Works fine so far.
$endgroup$
– Thomas Weller
Mar 16 at 13:30




$begingroup$
The plugin is cool. Works fine so far.
$endgroup$
– Thomas Weller
Mar 16 at 13:30












$begingroup$
It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
$endgroup$
– thibsert
Mar 16 at 13:39




$begingroup$
It works but is insecure (ie, it drops an error if used in Object mode), and i can't guarantee it won't crash Blender. Using Dynamic Context as suggested by Mr Zak seems way better (and it's build-in).
$endgroup$
– thibsert
Mar 16 at 13:39












$begingroup$
I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
$endgroup$
– batFINGER
Mar 16 at 15:29




$begingroup$
I wonder why the bother with the context overriding in your addon. Consider having it poll only when in 3d view and edit mode. As it is it will fail silently when run when no 3d views in screen.
$endgroup$
– batFINGER
Mar 16 at 15:29












$begingroup$
I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
$endgroup$
– thibsert
Mar 16 at 15:35






$begingroup$
I still don't understand that context thing really well. Before packing it as an addon I was running it trough the script window, so the overriding was necessary (I think?). You say it's safe to remove it ? Edit : it works well without it, thank you!
$endgroup$
– thibsert
Mar 16 at 15:35














$begingroup$
Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
$endgroup$
– batFINGER
Mar 16 at 19:32




$begingroup$
Can override going the other way when testing in the text editor, ie if __name__ == "__main__": bpy.ops.my_new.operator(ctx, 'INVOKE_DEFAULT')
$endgroup$
– batFINGER
Mar 16 at 19:32













3












$begingroup$

Little bmesh helper script.



The process to move the origin involves making the new point the origin by subtracting it from all other verts, then translating the matrix world of the object such that the global location stays the same



Run in edit mode. Moves origin to selected geo.



import bpy
import bmesh
from mathutils import Vector
context = bpy.context

ob = context.edit_object
mw = ob.matrix_world
me = ob.data
bm = bmesh.from_edit_mesh(me)

selverts = [v.co for v in bm.verts if v.select]
if len(selverts):
pt = sum(selverts, Vector()) / len(selverts)
#T = Matrix.Translation(-pt)
bmesh.ops.translate(bm, vec=-pt, verts=bm.verts)
mw.translation = mw @ pt # replace @ with * for 2.7x
bmesh.update_edit_mesh(me)


As an addon for 2.80



enter image description here






share|improve this answer











$endgroup$













  • $begingroup$
    does it work for blender 2.78a,2.79?
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:13






  • 1




    $begingroup$
    Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
    $endgroup$
    – batFINGER
    Mar 16 at 19:16












  • $begingroup$
    well anyways the other addon works for me too
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:19






  • 1




    $begingroup$
    Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
    $endgroup$
    – batFINGER
    Mar 16 at 19:24








  • 1




    $begingroup$
    This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
    $endgroup$
    – thibsert
    Mar 16 at 23:02
















3












$begingroup$

Little bmesh helper script.



The process to move the origin involves making the new point the origin by subtracting it from all other verts, then translating the matrix world of the object such that the global location stays the same



Run in edit mode. Moves origin to selected geo.



import bpy
import bmesh
from mathutils import Vector
context = bpy.context

ob = context.edit_object
mw = ob.matrix_world
me = ob.data
bm = bmesh.from_edit_mesh(me)

selverts = [v.co for v in bm.verts if v.select]
if len(selverts):
pt = sum(selverts, Vector()) / len(selverts)
#T = Matrix.Translation(-pt)
bmesh.ops.translate(bm, vec=-pt, verts=bm.verts)
mw.translation = mw @ pt # replace @ with * for 2.7x
bmesh.update_edit_mesh(me)


As an addon for 2.80



enter image description here






share|improve this answer











$endgroup$













  • $begingroup$
    does it work for blender 2.78a,2.79?
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:13






  • 1




    $begingroup$
    Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
    $endgroup$
    – batFINGER
    Mar 16 at 19:16












  • $begingroup$
    well anyways the other addon works for me too
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:19






  • 1




    $begingroup$
    Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
    $endgroup$
    – batFINGER
    Mar 16 at 19:24








  • 1




    $begingroup$
    This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
    $endgroup$
    – thibsert
    Mar 16 at 23:02














3












3








3





$begingroup$

Little bmesh helper script.



The process to move the origin involves making the new point the origin by subtracting it from all other verts, then translating the matrix world of the object such that the global location stays the same



Run in edit mode. Moves origin to selected geo.



import bpy
import bmesh
from mathutils import Vector
context = bpy.context

ob = context.edit_object
mw = ob.matrix_world
me = ob.data
bm = bmesh.from_edit_mesh(me)

selverts = [v.co for v in bm.verts if v.select]
if len(selverts):
pt = sum(selverts, Vector()) / len(selverts)
#T = Matrix.Translation(-pt)
bmesh.ops.translate(bm, vec=-pt, verts=bm.verts)
mw.translation = mw @ pt # replace @ with * for 2.7x
bmesh.update_edit_mesh(me)


As an addon for 2.80



enter image description here






share|improve this answer











$endgroup$



Little bmesh helper script.



The process to move the origin involves making the new point the origin by subtracting it from all other verts, then translating the matrix world of the object such that the global location stays the same



Run in edit mode. Moves origin to selected geo.



import bpy
import bmesh
from mathutils import Vector
context = bpy.context

ob = context.edit_object
mw = ob.matrix_world
me = ob.data
bm = bmesh.from_edit_mesh(me)

selverts = [v.co for v in bm.verts if v.select]
if len(selverts):
pt = sum(selverts, Vector()) / len(selverts)
#T = Matrix.Translation(-pt)
bmesh.ops.translate(bm, vec=-pt, verts=bm.verts)
mw.translation = mw @ pt # replace @ with * for 2.7x
bmesh.update_edit_mesh(me)


As an addon for 2.80



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 16 at 17:19

























answered Mar 16 at 15:54









batFINGERbatFINGER

26.3k52876




26.3k52876












  • $begingroup$
    does it work for blender 2.78a,2.79?
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:13






  • 1




    $begingroup$
    Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
    $endgroup$
    – batFINGER
    Mar 16 at 19:16












  • $begingroup$
    well anyways the other addon works for me too
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:19






  • 1




    $begingroup$
    Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
    $endgroup$
    – batFINGER
    Mar 16 at 19:24








  • 1




    $begingroup$
    This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
    $endgroup$
    – thibsert
    Mar 16 at 23:02


















  • $begingroup$
    does it work for blender 2.78a,2.79?
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:13






  • 1




    $begingroup$
    Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
    $endgroup$
    – batFINGER
    Mar 16 at 19:16












  • $begingroup$
    well anyways the other addon works for me too
    $endgroup$
    – Michael Ben David
    Mar 16 at 19:19






  • 1




    $begingroup$
    Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
    $endgroup$
    – batFINGER
    Mar 16 at 19:24








  • 1




    $begingroup$
    This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
    $endgroup$
    – thibsert
    Mar 16 at 23:02
















$begingroup$
does it work for blender 2.78a,2.79?
$endgroup$
– Michael Ben David
Mar 16 at 19:13




$begingroup$
does it work for blender 2.78a,2.79?
$endgroup$
– Michael Ben David
Mar 16 at 19:13




1




1




$begingroup$
Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
$endgroup$
– batFINGER
Mar 16 at 19:16






$begingroup$
Without testing (library upgrades for 2.80 have bombed my 2.79 build, too lazy to fix atm) Pretty sure the required changes to make it work for 2.7x is replacing any @ with * and change the version accordingly in bl_info
$endgroup$
– batFINGER
Mar 16 at 19:16














$begingroup$
well anyways the other addon works for me too
$endgroup$
– Michael Ben David
Mar 16 at 19:19




$begingroup$
well anyways the other addon works for me too
$endgroup$
– Michael Ben David
Mar 16 at 19:19




1




1




$begingroup$
Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
$endgroup$
– batFINGER
Mar 16 at 19:24






$begingroup$
Yes this one is by no means better, simply more "mesh-centric". The other addon in theory will also work for other types like curve and armature too. Script wise wanted to show how to do this without toggling edit mode, which can mean death to an edit bmesh.
$endgroup$
– batFINGER
Mar 16 at 19:24






1




1




$begingroup$
This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
$endgroup$
– thibsert
Mar 16 at 23:02




$begingroup$
This one also works better with the Undo logic of Blender. As the Undo history is independent in Edit and Object mode, the other addon leads to a hard to predict behavior when using Undo.
$endgroup$
– thibsert
Mar 16 at 23:02


















draft saved

draft discarded




















































Thanks for contributing an answer to Blender Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f134440%2fshortcut-for-setting-origin-to-vertex%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

Fil:Tokke komm.svg

Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?