3D cursor transform to object transform

Don’t know if this functionality already exists, but had a need for it so quickly wrote it.

If you happen to apply your transform, and can’t move an object along a proper axis anymore, you can snap cursor to your object surface and rebuild the transform from that.

https://raw.githubusercontent.com/amb/blender-scripts/master/cursor_to_transform.py

Hope you find it useful.

7 Likes

No joke, I just spent an hour trying to figure out how to do this in Blender because I really needed it. Thank you!!

If you continue to update this I’d love a way to bind a key to this because I can see myself using this often.

EDIT: I swear that your script is actually fixing a bug that I keep having in Blender. If I snap the 3D cursor to an edge it will align one axis but the other two go off randomly. If I run your script after that, re-align the cursor, it actually is fixed.

EDIT 3: In this image I snapped to the edge that’s running across the front face of this cylinder (top left). You can see the axis are off, even after I run your script (top right). However, if I snap the 3D cursor again immediately after running your script once it fixes it (bottom left) and then running your script a second time fixes it to a usable state (bottom right). So it’s not that your script breaks anything, it actually fixes the issue that exists in Blender for me.

1 Like

I think I lost something. I can not make this work. Using screencast keys would greatly facilitate understanding.

You need to turn on snapping to surface for the 3D cursor and the cursor taking the surface normal. Then just run the script. That’s it.

So I’m pretty new to Blender and am unsure of how to do these steps, particularly the cursor inheriting the surface normal. I can get the snapping part (see above) but am curious on if the surface normal inheriting is what I’m missing. Can you point out how to enable that step, please?

Sure, here’s how you could use it:
cursor_a
Here’s how I use it (no need to use active 3D cursor tool):
cursor_b

The 2.80 settings are still in flux though, so it’s not certain how the devs intend on it to be used. 3D cursor rotation is something that is new to 2.80, so at least that is almost certain to stay.

Thanks! It looks like that’s how I have it already yet somehow the initial snap to edge makes the other two axis (X and Y) go at a 45 degree angle compared to the face surface. Really weird.

3d%20cursor%20pre

Then after I run your script once:
3d%20cursor%20post

I hope you don’t mind but I modified the script so that it’s accessible from the right click menu (right click to me, maybe left click to others). Figured I’d share it in case others are like me and don’t like going through the search menu. :slight_smile:
cursor_to_transform.py (1.6 KB)

It’s good. You’re free to modify it anyway that works out for you and share it.

I put the script on Github so it’s easier to develop further if necessary: https://github.com/amb/blender-scripts/blob/master/cursor_to_transform.py

Pull requests, bug reports etc. There’s now also a button here (I looked at your code and it was easy to implement similar kind of thing to the existing 3D cursor panel instead of the context menu):

cursor2

And the operator should work in all modes, including object and edit.

2 Likes

That’s great! Thanks for the updates. I’m no programmer so my updates were just a lot of tinkering until things worked :wink:. This is legit the only thing I can see the 3d cursor being useful for so I’m really excited to build this into my workflow.

Here’s another thing:

I’m sure there’s a better way to do this, but I haven’t found such a thing, so hacked it together. :sweat_smile:

2 Likes

Thank you very very much for this great addon! I have been looking for something like this since I first started learning Blender! Is it possible to offer you a beer or a coffee for this?

2 Likes

Sure, it’s up at https://gumroad.com/l/b3d3d if you want to do that.

Thanks a lot, just purchased it for 5€, just my little way to say thank you!
Michele

Thank you, much appreciated.

BADASS!
Finally someone made it. It’s such a simple and obvious thing that I always got surprised when it turned out that this feature is absent from Blender. Not anymore!
Thanks!

Right? Up until this add-on I couldn’t figure out what use the 3d cursor was and usually it was more of a pain in the butt than helpful. Not anymore!

Honestly I think I’ll use this so much I wouldn’t be opposed to it getting a keymap option.

well, you already can

image

Dang, I’m not that bright today. Thanks for letting me know, this is great!

Am I wrong or does this not seem to work the way it used to? Is it possible a recent Blender update broke it?