First changes to implement the 2.5 snapping proposal (discussed back in May and recently on IRC).

http://wiki.blender.org/index.php/User:Theeth/Snapping

The new widget isn't there yet, but the rest works, including:

Increment (gears) is now a snap mode

Ctrl click to toggle snap on or off (in transform and 3d view)
Shift+Ctrl click to select snap mode (3d view only)

Snap status (on/off) is persisted in tool settings, no need to always turn it back on when entering transform.

It's still possible to have something resembling the old system by editing the transform modal keymap to snap on on ctrl press and snap off on key release.
This commit is contained in:
2009-11-26 19:47:55 +00:00
parent 6ca1c913d3
commit 74715d00cc
8 changed files with 146 additions and 107 deletions

View File

@@ -83,11 +83,13 @@ typedef struct NumInput {
*/
typedef struct TransSnap {
short mode;
short modePoint;
short modeTarget;
short mode;
short modeSelect;
short align;
short project;
short peel;
short status;
float snapPoint[3]; /* snapping from this point */
float snapTarget[3]; /* to this point */
@@ -371,7 +373,7 @@ typedef struct TransInfo {
/* TransInfo->modifiers */
#define MOD_CONSTRAINT_SELECT 0x01
#define MOD_PRECISION 0x02
#define MOD_SNAP_GEARS 0x04
#define MOD_SNAP 0x04
#define MOD_CONSTRAINT_PLANE 0x08
@@ -412,14 +414,9 @@ typedef struct TransInfo {
#define TD_MIRROR_EDGE (1 << 16) /* For editmode mirror, clamp to x = 0 */
/* transsnap->status */
#define SNAP_ON 1
#define SNAP_FORCED 2
#define TARGET_INIT 4
#define POINT_INIT 8
/* transsnap->modePoint */
#define SNAP_GRID 0
#define SNAP_GEO 1
#define SNAP_FORCED 1
#define TARGET_INIT 2
#define POINT_INIT 4
/* transsnap->modeTarget */
#define SNAP_CLOSEST 0