[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13669] trunk/blender/source/blender: * " Drag Immediately" transform user preference.

Matt Ebb matt at mke3.net
Wed Feb 13 14:26:46 CET 2008


Revision: 13669
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13669
Author:   broken
Date:     2008-02-13 14:26:46 +0100 (Wed, 13 Feb 2008)

Log Message:
-----------
* "Drag Immediately" transform user preference.

It's already supported within transform, was previously known as 'tweak mode' and for some odd reason was a compile time option. This brings it to a user preference (in 'Edit Methods' section).

Basically it means that you don't need the extra click at the end to confirm a drag-move transform, if you're already dragged, you can just let go of the mouse rather than needing to click again. It's a lot more comfortable when you're used to using other applications as well as blender, and much more sensible for tablets.

This started life as patch #7144 by Ed Britton, but this implementation has been changed considerably.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/src/editaction.c
    trunk/blender/source/blender/src/editipo.c
    trunk/blender/source/blender/src/editnla.c
    trunk/blender/source/blender/src/editobject.c
    trunk/blender/source/blender/src/space.c

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2008-02-13 13:25:19 UTC (rev 13668)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2008-02-13 13:26:46 UTC (rev 13669)
@@ -236,6 +236,7 @@
 #define USER_ADD_EDITMODE		(1 << 18)
 #define USER_ADD_VIEWALIGNED	(1 << 19)
 #define USER_RELPATHS			(1 << 20)
+#define USER_DRAGIMMEDIATE			(1 << 21)
 
 /* viewzom */
 #define USER_ZOOM_CONT			0

Modified: trunk/blender/source/blender/src/editaction.c
===================================================================
--- trunk/blender/source/blender/src/editaction.c	2008-02-13 13:25:19 UTC (rev 13668)
+++ trunk/blender/source/blender/src/editaction.c	2008-02-13 13:26:46 UTC (rev 13669)
@@ -1125,6 +1125,7 @@
 {
 	void *data;
 	short datatype;
+	short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
 	
 	/* determine what type of data we are operating on */
 	data = get_action_context(&datatype);
@@ -1133,25 +1134,25 @@
 	switch (mode) {
 		case 'g':
 		{
-			initTransform(TFM_TIME_TRANSLATE, CTX_NONE);
+			initTransform(TFM_TIME_TRANSLATE, context);
 			Transform();
 		}
 			break;
 		case 's':
 		{
-			initTransform(TFM_TIME_SCALE, CTX_NONE);
+			initTransform(TFM_TIME_SCALE, context);
 			Transform();
 		}
 			break;
 		case 't':
 		{
-			initTransform(TFM_TIME_SLIDE, CTX_NONE);
+			initTransform(TFM_TIME_SLIDE, context);
 			Transform();
 		}
 			break;
 		case 'e':
 		{
-			initTransform(TFM_TIME_EXTEND, CTX_NONE);
+			initTransform(TFM_TIME_EXTEND, context);
 			Transform();
 		}
 		break;

Modified: trunk/blender/source/blender/src/editipo.c
===================================================================
--- trunk/blender/source/blender/src/editipo.c	2008-02-13 13:25:19 UTC (rev 13668)
+++ trunk/blender/source/blender/src/editipo.c	2008-02-13 13:26:46 UTC (rev 13669)
@@ -5316,6 +5316,7 @@
 void transform_ipo (int mode)
 {
 	short tmode;
+	short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
 	
 	/* data-validation */
 	if (G.sipo->ipo && G.sipo->ipo->id.lib) return;
@@ -5341,12 +5342,12 @@
 	get_status_editipo();
 	if (totipo_vertsel) {
 		/* we're probably in editmode, so only selected verts - transform system */
-		initTransform(tmode, CTX_NONE);
+		initTransform(tmode, context);
 		Transform();
 	}
 	else if (totipo_edit==0 && totipo_sel!=0) {
 		/* we're not in editmode, so entire curves get moved - transform system*/
-		initTransform(tmode, CTX_NONE);
+		initTransform(tmode, context);
 		Transform();
 	}
 	else {

Modified: trunk/blender/source/blender/src/editnla.c
===================================================================
--- trunk/blender/source/blender/src/editnla.c	2008-02-13 13:25:19 UTC (rev 13668)
+++ trunk/blender/source/blender/src/editnla.c	2008-02-13 13:26:46 UTC (rev 13669)
@@ -1010,22 +1010,24 @@
 
 void transform_nlachannel_keys(int mode, int dummy)
 {
+	short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
+
 	switch (mode) {
 		case 'g':
 		{
-			initTransform(TFM_TIME_TRANSLATE, CTX_NONE);
+			initTransform(TFM_TIME_TRANSLATE, context);
 			Transform();
 		}
 			break;
 		case 's':
 		{
-			initTransform(TFM_TIME_SCALE, CTX_NONE);
+			initTransform(TFM_TIME_SCALE, context);
 			Transform();
 		}
 			break;
 		case 'e':
 		{
-			initTransform(TFM_TIME_EXTEND, CTX_NONE);
+			initTransform(TFM_TIME_EXTEND, context);
 			Transform();
 		}
 			break;

Modified: trunk/blender/source/blender/src/editobject.c
===================================================================
--- trunk/blender/source/blender/src/editobject.c	2008-02-13 13:25:19 UTC (rev 13668)
+++ trunk/blender/source/blender/src/editobject.c	2008-02-13 13:26:46 UTC (rev 13669)
@@ -4063,6 +4063,7 @@
 	short xo, yo;
 	short timer=0;
 	short mousebut;
+	short context = (U.flag & USER_DRAGIMMEDIATE)?CTX_TWEAK:CTX_NONE;
 	
 	/* check for left mouse select/right mouse select */
 	
@@ -4076,20 +4077,16 @@
 	getmouseco_areawin(mval);
 	xo= mval[0]; 
 	yo= mval[1];
-	
+	 
 	while(get_mbut() & mousebut) {
 		getmouseco_areawin(mval);
 		if(abs(mval[0]-xo)+abs(mval[1]-yo) > 10) {
 			if(curarea->spacetype==SPACE_VIEW3D) {
-#ifdef TWEAK_MODE
-				initTransform(TFM_TRANSLATION, CTX_TWEAK);
-#else
-				initTransform(TFM_TRANSLATION, CTX_NONE);
-#endif
+				initTransform(TFM_TRANSLATION, context);
 				Transform();
 			}
 			else if(curarea->spacetype==SPACE_IMAGE) {
-				initTransform(TFM_TRANSLATION, CTX_NONE);
+				initTransform(TFM_TRANSLATION, context);
 				Transform();
 			}
 			else if(xf_func)

Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c	2008-02-13 13:25:19 UTC (rev 13668)
+++ trunk/blender/source/blender/src/space.c	2008-02-13 13:26:46 UTC (rev 13669)
@@ -3454,33 +3454,37 @@
 	else if (U.userpref == 0) { /* view & controls */
 
 		uiDefBut(block, LABEL,0,"Display:",
-			xpos,y6label,spref,buth,
+			xpos,y7label,spref,buth,
 			0, 0, 0, 0, 0, "");	
 		uiBlockBeginAlign(block);
 		uiDefButBitI(block, TOG, USER_TOOLTIPS, 0, "Tool Tips",
-			(xpos+edgsp),y5,spref,buth,
+			(xpos+edgsp),y6,spref,buth,
 			&(U.flag), 0, 0, 0, 0,
 			"Display tooltips (help tags) over buttons");
 		uiDefButBitI(block, TOG, USER_DRAWVIEWINFO, B_DRAWINFO, "Object Info",
-			(xpos+edgsp),y4,spref,buth,
+			(xpos+edgsp),y5,spref,buth,
 			&(U.uiflag), 0, 0, 0, 0,
 			"Display active object name and frame number in the 3D View");
 		uiDefButBitI(block, TOG, USER_SCENEGLOBAL, 0, "Global Scene",
-			(xpos+edgsp),y3,spref,buth,
+			(xpos+edgsp),y4,spref,buth,
 			&(U.flag), 0, 0, 0, 0,
 			"Forces the current Scene to be displayed in all Screens");
 #ifndef __APPLE__	
 		uiDefButBitS(block, TOG, 1, 0, "Large Cursors",
-			(xpos+edgsp),y2,spref,buth,
+			(xpos+edgsp),y3,spref,buth,
 			&(U.curssize), 0, 0, 0, 0,
 			"Use large mouse cursors when available");
 #else 
 		U.curssize=0; /*Small Cursor always for OS X for now */
 #endif
 		uiDefButBitI(block, TOG, USER_SHOW_VIEWPORTNAME, B_DRAWINFO, "View Name",
+			(xpos+edgsp),y2,spref,buth,
+			&(U.uiflag), 0, 0, 0, 0,
+			"Show the name of the view's direction in each 3D View");
+		uiDefButBitI(block, TOG, USER_SHOW_FPS, B_DRAWINFO, "Playback FPS",
 			(xpos+edgsp),y1,spref,buth,
 			&(U.uiflag), 0, 0, 0, 0,
-			"Show the name of the view's direction in each 3D View");
+			"Show the frames per second screen refresh rate, while animation is played back");
 		uiBlockEndAlign(block);
 
 		uiDefBut(block, LABEL,0,"Menus:",
@@ -3622,15 +3626,11 @@
 				0, 0, 0, 0, 0, "");
 		}
 		
-		uiDefButBitI(block, TOG, USER_SHOW_FPS, B_DRAWINFO, "Display FPS in View",
-			(xpos+edgsp+(3*mpref)+(4*midsp)),y2,mpref,buth,
-			&(U.uiflag), 0, 0, 0, 0,
-			"Display the number of frames per secons being drawn");
-		
 		/* illegal combo... */
 		if (U.flag & USER_LMOUSESELECT) 
 			U.flag &= ~USER_TWOBUTTONMOUSE;
 		
+		uiBlockBeginAlign(block);
 		uiDefButBitI(block, TOG, USER_TWOBUTTONMOUSE, B_DRAWINFO, "Emulate 3 Button Mouse",
 			(xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth,
 			&(U.flag), 0, 0, 0, 0,
@@ -3741,6 +3741,14 @@
 		uiBlockEndAlign(block);
 
 
+		uiDefBut(block, LABEL,0,"Transform:",
+			(xpos+(2*edgsp)+mpref),y5label, mpref,buth,
+			0, 0, 0, 0, 0, "");
+		uiDefButBitI(block, TOG, USER_DRAGIMMEDIATE, B_DRAWINFO, "Drag Immediately",
+			(xpos+edgsp+mpref+midsp),y4,mpref,buth,
+			&(U.flag), 0, 0, 0, 0, "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users)");
+		uiBlockEndAlign(block);
+
 		uiDefBut(block, LABEL,0,"Undo:",
 			(xpos+(2*edgsp)+mpref),y3label, mpref,buth,
 			0, 0, 0, 0, 0, "");





More information about the Bf-blender-cvs mailing list