Page MenuHome

Measure Tool: Do not snap to face in wireframe mode
Needs ReviewPublic

Authored by Germano Cavalcante (mano-wii) on Apr 28 2022, 5:50 PM.

Details

Summary

Unset the SCE_SNAP_MODE_FACE flag from the measure gizmo if the
view mode is wireframe.


Snap to face mode does not allow elements behind an object to be snapped.

This can limit the workflow of the user who sets the wireframe mode in order to measure something occluded.

Diff Detail

Repository
rB Blender
Branch
snap_measure_wireframe (branched from master)
Build Status
Buildable 21879
Build 21879: arc lint + arc unit

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Apr 28 2022, 5:50 PM
Germano Cavalcante (mano-wii) created this revision.

While this patch seems OK, could this be supported by the gizmo it's self? (this avoids every user having to add a refresh callback).

While this patch seems OK, could this be supported by the gizmo it's self? (this avoids every user having to add a refresh callback).

One advantage of supporting this in wmGizmoGroup instead of wmGizmo or cursor, is that wmGizmoGroup has a refresh function which allows for fewer updates.

But disregarding that, currently the Snap Cursor has two modes in V3DSnapCursorState.snap_elem_force for choosing snap elements.
If the value is:

  • 0: Elements defined in scene settings are used.
  • non-zero: SCE_SNAP_MODE_ flags in are used.

To support this "dynamic" mode (which varies by wireframe mode), the Snap Cursor must support different modes.
A proposed API for these modes could be this:

/** #V3DSnapCursorState.snap_elem_force */

/* Default snapping mode for geometry that considers wireframe. /*
#define SNAP_DEFAULT_GEOMETRY 0,

/* Use scene settings. Can be combined with other modes. */
#define SNAP_DEFAULT_SCENE (1 << 15),

With this change, the same feature can be easily implemented in View3D's Placement Gizmo and DragDrop cursor. (No need for a refresh callback).
Is that the idea?

  • implement SNAP_DEFAULT_GEOMETRY and SNAP_DEFAULT_SCENE