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

Uh, thanks! Totally forgot about location ^^"
I suppose storing settings between sessions is not hard, I just had no experience with that part of API yet. Should all settings be stored, or some yes and some not?

Hmm, I guess I’ll also post here the list of currently accumulated ideas for the future versions. Would be nice to know your opinions on that :cool:

Features planned for up to 2.0 versions:

  • Create a wiki page

  • UI panel to manage operator settings (perhaps somewhere in View3D Properties)

  • Some functionality of seminumerical’s cursor tools
    – Stored Locations
    – Cursor position history
    – An API to access history/SL from other scripts

  • Make absolute origin of all systems different from cursor starting location

  • Synchronize Blender’s “snap during transform” and “type of element to snap to” with script’s snap settings

  • Pressing snapping keys automatically enables raycasting

  • A shortcut for “all zeros in the coordinate system”, e.g. Ctrl+(G L N I J M B U 0), 0 is for currently selected

  • Pressing F10 second time would be considered a confirmation

  • Save settings with .blend (or even for the whole Blender?)

  • ‘NORMAL’ coordinate system


Features planned for undecided time in future:

  • Use smooth groups & related parameters when calculating interpolated normal

Uncertain ideas:

  • Display distance to origin / allow such constraint? I don’t know if this feature would be really useful.

  • Draw nearest snapping locations?


Hmm, seems like the feature <<synchronize Blender’s “snap during transform” and “type of element to snap to” with script’s snap settings>> is not fully possible.

Edit:
I think I found a way to make script’s snapping modes correspond to the ones present in Blender.

Please note that features and keymappings are currently in flux, since I haven’t yet decided how to organize them best.

Actually there were plans for advanced cursor snapping! http://wiki.blender.org/index.php/Dev:Source/Development/Proposals/Advanced_snapping_system ! They supercede my current ideas in many ways. It would be nice to actually build such unified system… Though this may involve redesign of other transform operators %)

Current state of affairs:
Now I’m working on a complete rewrite of the script. This time I’m trying to make it more interoperable with existing Blender settings and tools.

A work-in-progress GUI screenshot (in View3D Properties panel):

The one big issue I’ve stumbled upon is the impossibility to store non-undoable data. I may find a partial workaround for specific use-cases… But in general that means it’s impossible to write a reliable “cursor history”/“bookmarked locations” tool using current Python API.

The new interface looks busy and interesting. Keep it up!

The script has reached version 2.0. Now I uploaded it to SourceForge https://sourceforge.net/p/blender-cursor/code-0/2/tree/trunk/enhanced_3d_cursor.py
Manual: http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/3D_interaction/Enhanced_3D_Cursor

Now also on blenderpython svn: http://blenderpython.svn.sourceforge.net/viewvc/blenderpython/259/scripts/addons_extern/enhanced_3d_cursor.py?revision=99&content-type=text%2Fplain

I can’t breath . . . that is awesome . . . I never understand how someone can scale, rotate from some exact place of a mesh with existing system of snapping cursor to something or origin effectively. Thank you, thank you, thank you . . .

From the first impression it has for me more than I’m able to utilize :slight_smile:
I would love to see your addon integrated to existing manipulator.

I have just one problem - for now I have to disable your addon before I want to use blender’s manipulator.

Does your addon can accept manipulator space let to work together? Or even beter can your addon use blenders UI and work like in this video?

(In this video I erased parts I had to switch to preferences disable addon to be able use manipulator.)

One cosmetics note: can be stored XYZ information in a bottom of 3d window as blender use for all?

http://blender.howto.cz/blender-links/3d-cursor-xyz/3D-cursor-XYZ.jpg

Hmm… Perhaps the quickest fix is to change addon’s shortcut (in User Preferences->Input->3D View->Enhanced 3D Cursor), e.g. to Alt+ActionMouse or Ctrl+Alt+ActionMouse. …Or, alternatively, you can use keyboard shortcuts for grab/rotate/scale operations :wink:
To actually allow the manipulator widget to take precedence, I need to know whether mouse is over manipulator. Blender API currently provides no way of knowing that.

As for XYZ information at the bottom of 3d window – perhaps it’s possible to do from script (though I’m not sure), but I think the vertical layout is way more readable :wink:

Ah . . . you are right :slight_smile:
Alt+ActionMouse is used for view rotation, but Ctrl+ActionMouse is OK :slight_smile:
FreeMose that is under ActionMouse now - I don’t know for what to use it anyway and Ctrl is used in blender for snaping by default, so it’s clear to use. Thank you

(Before I used only keyboard shortcuts for grab/rotate/scale operations, just with your addon it sounds me like its better use the manipulator instead of watching keyboard :slight_smile: )

XYZ info

  • ok, my question comes from view to keep blender GUI unified?

  • like:
    http://blender.howto.cz/blender-links/3d-cursor-xyz/3D-cursor-XYZ-unify.jpg

  • or
    http://blender.howto.cz/blender-links/3d-cursor-xyz/3D-cursor-XYZ-rightside.png

  • or maybe it’s only spacing problem?
    http://blender.howto.cz/blender-links/3d-cursor-xyz/3D-cursor-XYZ-line.png

Anyway in a way you use XYZ info now it’s hard to see too.
But as I sad it’s just cosmetic compare to your addon function :slight_smile:
Thanks

Hmm, Ctrl+ActionMouse is used for “lasso selection”.

Unification would be nice! I’ll try the variant with dark rounded box and the one with text in the header… Perhaps the following week.

Now it displays coordinates in the header:

Latest version is currently at https://sourceforge.net/p/blender-cursor/code-0/2/tree/trunk/enhanced_3d_cursor.py

header looks great, ill check it morning
now is spacing better than blender use by default
thanks

black box is too dominant and located on a strange place
and some restriction for amount of decimal numbers (like 3) would be great :slight_smile:

There are a number of features I’m currently considering to add:

  • some additional information to be displayed in the header (current coordinate system, pivot mode, snap element)
  • snap to boundbox (when bounding box is displayed)
  • take into account the “X-Ray” object property
  • draw nearest snapping locations (vertices / points on edges / grid points)

It would be nice to know opinions of Blender users before starting to implement that :slight_smile:

Ctrl+ActionMouse - that is right - Lasso Tool
Now I noticed - If I leave your shortcut setup like it is :slight_smile: Manipulator is available if I hold Ctrl Key :slight_smile: but it also activates blenders snap tool. OK there is no way for now.

XYZ is in blue box in your last script link

Snap Bounding Box sounds logical if you want a scale object like Suzanne from box corner.
X-Ray - what do you mean?
Draw nearest - not sure how do you want to visualized, but it’s going to be too much featured for me. The only one thing I very appreciate is Snapping Cursor to . . …

Hehe, actually I found a way to make the addon work with manipulator! Turns out it was very simple: I just needed to put the addon at the bottom of user keymaps (that way manipulator keymap takes precedence) and turn off the default cursor3d operator :wink:

Added snapping to boundbox (now this mode corresponds to “VOLUME” snap element, which was previously unused).

Made more convenient coordinate display/editing (now it’s located in the header).

“X-ray” is located in Properties->Object->Display panel. If enabled, it allows you to see the object even if it should be logically occluded by other objects.

Here is the correct link to SourceForge (atomatically redirects to the last revision):
https://sourceforge.net/p/blender-cursor/code-0/
the script is in the trunk/ subdirectory.

Also, uploaded here: http://projects.blender.org/tracker/download.php/153/467/28451/17935/enhanced_3d_cursor.py

Here are some features I’m thinking to also add/change:

  • Keyboard shortcuts to change pivot mode
    – T – manipulate object centers only
    – H – active element
    – U – cursor
    – I – individual origins
    – O – bounding box center
    – P – midpoint
    – Ctrl+shortcut to also snap cursor to pivot

  • Rotate / Scale cursor around the pivot
    – to switch between moving/rotating/scaling the cursor, G / R / S shortcuts will be used accordingly

:3

thanks for manipulator and XYZ info, works with glance :slight_smile: but UNDO is not working in my 40676 version on intel mac
(with older versions of your script too)