3D cursor with orientation by geometry projects on object displays as bounds box / wire #70606

Closed
opened 2019-10-07 16:26:12 +02:00 by Michael Soluyanov · 17 comments

System Information
Operating system: Linux-4.15.0-62-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116

Blender Version
Broken: version: 2.81 (sub 14), branch: master, commit date: 2019-10-06 14:05, hash: 54a9649e26
Worked: nope

Short description of error
3D cursor with orientation by geometry projects on object displays as bounds box / wire.
Looks weird, that changing orientation changes depth culling behavior

Exact steps for others to reproduce the error
3d cursor test.blend

  • in this file try to put 3d cursor on the surface of cube:
    {F7794696, size=full}
  • look from side view:

orientation by view:
{F7794698, size=full}
orientation by geometry:
{F7794700, size=full}

**System Information** Operating system: Linux-4.15.0-62-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116 **Blender Version** Broken: version: 2.81 (sub 14), branch: master, commit date: 2019-10-06 14:05, hash: `54a9649e26` Worked: nope **Short description of error** 3D cursor with orientation by geometry projects on object displays as bounds box / wire. Looks weird, that changing orientation changes depth culling behavior **Exact steps for others to reproduce the error** [3d cursor test.blend](https://archive.blender.org/developer/F7794693/3d_cursor_test.blend) * in this file try to put 3d cursor on the surface of cube: {[F7794696](https://archive.blender.org/developer/F7794696/Снимок_экрана_от_2019-10-07_17-22-39.png), size=full} * look from side view: orientation by view: {[F7794698](https://archive.blender.org/developer/F7794698/Снимок_экрана_от_2019-10-07_17-24-52.png), size=full} orientation by geometry: {[F7794700](https://archive.blender.org/developer/F7794700/Снимок_экрана_от_2019-10-07_17-24-44.png), size=full}
Author
Member

Added subscriber: @crantisz

Added subscriber: @crantisz
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Cannot reproduce here (file works the same here in 2.8 official release and 7a1847f0e9)

Two things to check:

  • if you are using the Cursor Tool: you sure you dont have Geometry set as option for the Orientation? [I get some "off-the-surface" results then as well...]
  • are GPU drivers up to date? (more or less a shot in the dark, but these driver updates really do wonders nowadays...)
Cannot reproduce here (file works the same here in 2.8 official release and 7a1847f0e9) Two things to check: - if you are using the Cursor Tool: you sure you dont have `Geometry` set as option for the Orientation? [I get some "off-the-surface" results then as well...] - are GPU drivers up to date? (more or less a shot in the dark, but these driver updates really do wonders nowadays...)
Author
Member

@lichtwerk , yes, it's orientation by geometry. It's looks weird.. Did that behavior design that way?

@lichtwerk , yes, it's orientation by geometry. It's looks weird.. Did that behavior design that way?
Michael Soluyanov changed title from 3D cursor projects on object displays as bounds box / wire to 3D cursor with orientation by geometry projects on object displays as bounds box / wire 2019-10-08 17:44:38 +02:00
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Added subscribers: @mano-wii, @ideasman42

Added subscribers: @mano-wii, @ideasman42
Member

Coming back to this it seems we have a little inconsistency:

  • if you are using the Surface Project option (VIEW3D_OT_cursor3d.use_depth), blender will usually determine the new position using OpenGL (see ED_view3d_cursor3d_position)
  • however, if you are setting the Orientation to Geometry (VIEW3D_OT_cursor3d.orientation), this will end up using an entirely different system under the hood (instead of OpenGL it uses the snapping system)

If you look at your file (and have a look at how the geometry really is -- set Viewport Display to Wire instead of Bounds), then it turns out snapping is actually fine (both position and orientation).

Not quite sure how to handle this, there are following questions:

  • not sure the position (cursor_co) should also be determined by the snapping system (after all this was only used to get underlying surface normal to set the orientation...)
  • even if we would pick the position from OpenGL still [do not do copy_v3_v3(cursor_co, ray_co) in ED_view3d_cursor3d_position_rotation], question remains if we should use the rotation of non-visible geometry?

@mano-wii: is there something in place that will let us skip "unsuiting" objects? (I would count objects set to Bounds into this category, maybe others as well? Wire (optionally)?)
@ideasman42 : opinions?

Having said all this, this still doesnt really look like a bug, more like an improvement of the current implementation... [have to admit though that it is inconsistent...], still hesitating to close, waiting for opinions of devs above...

Coming back to this it seems we have a little inconsistency: - if you are using the `Surface Project` option (`VIEW3D_OT_cursor3d.use_depth`), blender will *usually* determine the new position using OpenGL (see `ED_view3d_cursor3d_position`) - however, if you are setting the `Orientation` to `Geometry` (`VIEW3D_OT_cursor3d.orientation`), this will end up using an entirely different system under the hood (instead of OpenGL it uses the snapping system) If you look at your file (and have a look at how the geometry really is -- set Viewport Display to Wire instead of Bounds), then it turns out snapping is actually fine (both position and orientation). Not quite sure how to handle this, there are following questions: - not sure the **position** (cursor_co) should also be determined by the snapping system (after all this was only used to get underlying surface normal to set the **orientation**...) - even if we would pick the position from OpenGL still [do **not** do `copy_v3_v3(cursor_co, ray_co)` in `ED_view3d_cursor3d_position_rotation`], question remains if we should use the rotation of non-visible geometry? @mano-wii: is there something in place that will let us skip "unsuiting" objects? (I would count objects set to `Bounds` into this category, maybe others as well? Wire (optionally)?) @ideasman42 : opinions? Having said all this, this still doesnt really look like a bug, more like an improvement of the current implementation... [have to admit though that it is inconsistent...], still hesitating to close, waiting for opinions of devs above...
Author
Member

I noted a similar issue then trying to set view center using Alt + MMB. Instead setting it on surface of visible mesh, it sets on object with bounding box\ wireframe viewport display

I noted a similar issue then trying to set view center using **Alt** + **MMB**. Instead setting it on surface of visible mesh, it sets on object with *bounding box*\ *wireframe* viewport display

There is a param in the snap API called use_occlusion_test.
It simulates OpenGL behavior as it considers only visible geometry.
I think it is justifiable to set this parameter to true in the cursor projection (since it matches its other types of projections).

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 45388ce3691..6d0b0e8e00a 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4954,6 +4954,7 @@ void ED_view3d_cursor3d_position_rotation(bContext *C,
                                                    &(const struct SnapObjectParams){
                                                        .snap_select = SNAP_ALL,
                                                        .use_object_edit_cage = false,
+                                                       .use_occlusion_test = true,
                                                    },
                                                    mval_fl,
                                                    NULL,

There is a param in the snap API called `use_occlusion_test`. It simulates OpenGL behavior as it considers only visible geometry. I think it is justifiable to set this parameter to `true` in the cursor projection (since it matches its other types of projections). ``` diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 45388ce3691..6d0b0e8e00a 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -4954,6 +4954,7 @@ void ED_view3d_cursor3d_position_rotation(bContext *C, &(const struct SnapObjectParams){ .snap_select = SNAP_ALL, .use_object_edit_cage = false, + .use_occlusion_test = true, }, mval_fl, NULL, ```
Member

There is a param in the snap API called use_occlusion_test

tested, LGTM, thx checking on this.

> There is a param in the snap API called use_occlusion_test tested, LGTM, thx checking on this.

This issue was referenced by 0187735eea

This issue was referenced by 0187735eea17ff580f80115bd840747400732fe7

This issue was referenced by 6d74775a47

This issue was referenced by 6d74775a47be00e4c62a984c2533c947fa1a402f

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Germano Cavalcante self-assigned this 2020-01-14 13:40:26 +01:00

Added subscriber: @tem

Added subscriber: @tem

Hello, I think this is related: the 3D cursor is being positioned on hidden faces* when I have enabled Surface Projection & Orientation: Geometry.

  • But only when I left click to place the cursor with the cursor tool active. It's fine if I hold shift and right click.

{F12776349, size=full}

Blender 3.0

Hello, I think this is related: the 3D cursor is being positioned on hidden faces* when I have enabled Surface Projection & Orientation: Geometry. * But only when I **left click** to place the cursor with the cursor tool active. It's fine if I hold shift and right click. {[F12776349](https://archive.blender.org/developer/F12776349/ezgif-7-a3c7842fc8.gif), size=full} Blender 3.0
Author
Member

Hi, Tem. This report has been being closed for several years. It's better to open a new one, even if it may be related.

Hi, Tem. This report has been being closed for several years. It's better to open a new one, even if it may be related.

Okay, thank you for your advice. 🙏 (two minutes, please)

Okay, thank you for your advice. 🙏 (two minutes, please)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#70606
No description provided.