A script to place cursor on objects' surface (and some other functionality)

How Undo is not working? 0_o
Could you describe in more detail?

Latest version is currently available at http://projects.blender.org/tracker/download.php/153/467/28451/17957/enhanced_3d_cursor.py
(I don’t have access to SVN right now)

Changes:

  • Added shortcuts for changing pivot mode. If “use object centers only” option is enabled, Vertex/Edge/Face/BBox snapping would snap to object centers instead.
  • Added rotation and scale mode.

PLEASE - can you write clearly link to the wiki in your first post?http://wiki.blender.org/index.php/Ex…nced_3D_Cursor
It took me half hour to find it. It looks it’s the only one place with actual informations on one place.
Progress of this script is to fast. I haven’t try all your features and shortcuts. It’s going to be hard to keep in.

UNDO - what I tested, it’s problem in edit mode. When I move some vertex, undo is not working since your addon is enabled.
If I move vertex in edit mode and switch to object mode I have to press undo 3times.
If I move vertex in edit mode and press undo once (that is not working) and switch to object mode I have to press undo 7times to get one undo step. (more than one undo in edit - can’t undo in object mode anymore)

Edit UNDO: OK, now when I open blender with addon disabled by default it works with your last 2.6.0 script version.

Second note - with enabled script by default script is not working. “3D cursor tools” panel in properties is empty. I have to disable/enable script in addon preferences to get it work.

One note to think about - isn’t it helpful to let cursor follow the actual snapped place?
Like if it’s a cube vertex and I move the cube cursor is still snapped to this cube vertex?
Thanks for your opinion.

BTW: What is rotation and scale mode?

Thanks for the advice! ^^" Edited the first post.
I’ll try to update the manual soon.

Another thanks for the bug report :smiley: Now it should work properly when enabled by default. (you can get the latest version from SourceForge SVN).

Also note that, even though the problem with UNDO is gone, there is still a catch. I have to exit-and-enter editmode to get relevant information about current selection. Thus, when the addon is enabled, any interactive edit-mode operator would automatically get applied when you click on 3D View.

…So, if my understanding is right, you suggest to “stick” the cursor to the local system of the object it was snapped to (or the active object?), until user moves the cursor again? Hmm, perhaps that’s doable :eyebrowlift2:

Rotation and scale modes work similarly to Rotate/Scale Object operations (they allow you to rotate/scale cursor’s position around the coordinate system origin). You can activate them by pressing R or S while dragging the cursor.

Added sticking (following the snapped object) :wink:

Dairin0d, you are making good progress on this script.

But let me express my feeling: I begin to doubt about its usefulness. I mean, I’m modeling quite a lot lately, an architectural project, and the standard “Snap cursor to…” feature works quite well so far.

Don’t get me wrong, I think this script is powerful, but didn’t find an occasion to use it.
Maybe that for organic modeling it saves time, I don’t know…

Just wanted to raise your attention to an important topic, that is if the script is useful or needed, let alone its sheer power.

Hope this makes sense, sorry for the bad wording.

Thanks :slight_smile:
I guess you’re right, the script mostly deals with exact cursor positioning, which is rarely needed for many Blender users. Well, I can’t speak for others, but here are my reasons for doing it:

  • Some addons/operators (such as IvyGen) use cursor position as their input parameter. If you want to place cursor on the surface of some object, my script allows you to do this way faster than, say, going to editmode, selecting a vertex, doing “Snap Cursor To …”, and exiting editmode. And to place cursor on arbitrary surface positions (or on surfaces of objects with modifiers), in the usual Blender you have to snap some object there first.

  • I felt it was too unecomical to spend the whole mousebutton click on such restrictive default implementation of cursor positioning :wink:

  • History and Bookmarks were added on the request of some people. They are useful for situations which require storing exact positions and offsets (e.g. CAD modeling, or when you don’t want to create an empty or vertex for each location you are going to use later).

  • In the script I’ve implemented my vision of how transformation operations (e.g. Grab/Move, Rotate, Scale) should work. Having it accessible to many people as a working addon is a much more efficient way of doing a feature proposal :wink:

  • Maybe, after seeing that cursor can be actually a very convenient “point-in-the-space” / “point-on-the-surface” tool, there will appear more applications for it :slight_smile:

  • It gives me a lot of experience in actual software development :wink: Before that I was just a hobbyist programmer and was only writing programs for my personal use :slight_smile:

ha haaa :slight_smile: my heart beats faster - thanks a lot - “sticking” cursor works great
(just it’s a shame it’s not working in edit mode)

About Scale, Rotation cursor? Sorry maybe I’m tired . . .

@Carrozza: “…standard “Snap cursor to…” feature works quite well so far…”
Sorry can’t say the same :slight_smile: If you try this addon can’t compare with existing system. If I need manipulate (scale, rot, move) with object in object mode or change Origin position - it’s like scratch your right ear by left hand over head - it’s totally noneffective.

I was also doubt if it’s not duplication of existing system (specially in edit mode, where you can quite effectively use transform from “active element”), but there is several features (as dairin0d wrote too) that effectively extend functionality of blender (also you don’t have to all the time switch the “pivot point” if you are able to snap cursor to most of them).
Since now was cursor totally passive, It’s great to see him become in live. I also hope it moves development to cursor direction.

I promise I’ll test again this script, no doubt it will make workflow faster once used to it.

vklidu, “sticking” cursor to mesh elements in principle can be done using the current Python API, but this would be prone to huge bugs and would have lots of undesirable side-effects :slight_smile:

Hi dairin0d, I just had a chance to try your script a bit and immediately one feature request came on top of my mind: would it be possible to have an option to snap the cursor to the middle of edge or face?
I find a bit confusing when the cursors just jumps around and is not always easy to understand what is the target it snapped to.
Thanks in advance.
Cheers!

…Done! :cool:
To snap to face/edge centers, hold Shift in the corresponding snapping mode.

Also added visualization of current snap elements (face, edges, points) and option to turn on/off surface normal visualization (on per-axis basis) :rolleyes:

Mamma mia, that was quick!
Gonna check it out as soon as possible and will report back.
Thanks man!

Edit: OK, I get “snap-in-the-middle” working but only in interactive mode (F10).
To be honest I use mainly the action-button to position the cursor.
I had a quick look at Blender’s input setup but didn’t see a way to change this behaviour, because both keyboard and mouse setup are assigned “view3d.cursor3d_enhanced” function, but it works in different ways if you use it with F10 and with mouse.
Any hint on how to make the button placement snap to the middle?
Thanks a lot!

Hmm, for me it works both with F10 and Action mouse button… Do you have any other operators assigned to Action mouse press? They can override the “view3d.cursor3d_enhanced” one.

Aaah, now I got it: I have a mouse gesture software running so I never click-drag with the mouse but just click instead.
I’ll try to find a way to bypass the mouse gesture by pressing a modifier, maybe it will work.
Thanks for your help, dairin0d, it was all my fault.

Moved to Contrib :slight_smile: https://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts/addons/space_view3d_enhanced_3d_cursor.py

The study found that computing power can compares the super computer.Discount sunglasses

@dairin0d@dairin0d, can you add a simple button to toggle visibility of 3D Cursor?
It it not used often in animation and sometimes it’s irritates a bit when pressing right mouse button (yes, I select with left).

UNDO problem is back, Does I’m only one (os x user) who has this problem? Thanks for feedback.
Tested on 41769 build.

Aha, I got it! :stuck_out_tongue: The problem is with the way Blender’s Undo system works.

Changing editor mode (e.g. to Object or Edit) is an undoable action in itself, so each time you toggle modes, these actions get inserted into the Undo history (Alt+Ctrl+Z). Even more, if in Edit-mode you undo some number of actions, then switch to a different mode, then switch back – you’ll see that the undone actions are removed from undo history.

Since currently there’s no way to get up-to-date mesh data while it’s in editmode, the script has to switch modes back-and-forth behind the scenes. For now, I disabled mode switching in some parts of code, so editmode would be toggled only if you try to snap cursor to geometry.

Hope that helps :eyebrowlift2:

you can turn off undo for certain operations or parts of code then turn it back on where needed.