Home Technical Talk

(Solved) [Blender] Place 3d cursor on grid by clicking, not snapping

polycounter lvl 6
Offline / Send Message
bitinn polycounter lvl 6
Is there any way to click on an empty space in 3d view and have 3d cursor land on the grid, not arbitrary depth in space? 

Blender 3d cursor can detect depth of any visible mesh, but I haven't found a solution that will detect depth of the grid. And I don't understand why Blender decides it's a good idea to just place the 3d cursor somewhere in space when "raycast" doesn't hit surface, any explanation?

(And yes I am aware of snapping options, just wondering what I can do without manual snapping.)

Replies

  • RN
    Offline / Send Message
    RN sublime tool
    bitinn said:
    Is there any way to click on an empty space in 3d view and have 3d cursor land on the grid, not arbitrary depth in space? 
    There is, read below.
    I don't understand why Blender decides it's a good idea to just place the 3d cursor somewhere in space when "raycast" doesn't hit surface, any explanation?
    It places the cursor on a plane aligned to the camera view, at the same distance to the camera that the cursor had before the mouse click.

    - - - - -
    Go to File > User Preferences > Input, and search for "cursor3d" using the Name filter (which searches for command names, instead of the Key-Binding filter which searches for literal keyboard key names), so this comes up:



    This keymap entry (located in the View 3D > View 3D (Global) category if searching manually) sets what happens when you action-click on the viewport: it calls operator "view3d.cursor3d" which does that cursor placing thing.
    If you replace this operator with any other, like one that shows a popup panel, or starts animation playback for example, then that's what would happen if you action-clicked.

    You can write a custom operator with Python and replace the contents of that field with your own operator.
    Download this script, install it in the Add-ons section and write view3d.bitinn_cursor3d in that field.
  • bitinn
    Offline / Send Message
    bitinn polycounter lvl 6
    @RN thx a lot for going through the trouble of writing a custom script for this question, some good learning info in that script too!
Sign In or Register to comment.