[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14897] branches/apricot: Snappy stuff

Martin Poirier theeth at yahoo.com
Mon May 19 16:16:28 CEST 2008


Revision: 14897
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14897
Author:   theeth
Date:     2008-05-19 16:16:18 +0200 (Mon, 19 May 2008)

Log Message:
-----------
Snappy stuff

* Align rotation with snapping target: rotate the object, aligning it with the target (object mode only - temporarily)

* Snap to different mesh elements (face, edge, vertice): snapping target slide on faces and edge or use exact position of vertice. When using Align rotation with edge snapping, the normal is interpolated as you slide along.

Removing ugly apricot hack for drop to ground (YAY!) 

Modified Paths:
--------------
    branches/apricot/release/datafiles/blenderbuttons
    branches/apricot/source/blender/include/BIF_resources.h
    branches/apricot/source/blender/include/transform.h
    branches/apricot/source/blender/makesdna/DNA_scene_types.h
    branches/apricot/source/blender/src/blenderbuttons.c
    branches/apricot/source/blender/src/header_view3d.c
    branches/apricot/source/blender/src/transform.c
    branches/apricot/source/blender/src/transform_generics.c
    branches/apricot/source/blender/src/transform_snap.c

Modified: branches/apricot/release/datafiles/blenderbuttons
===================================================================
(Binary files differ)

Modified: branches/apricot/source/blender/include/BIF_resources.h
===================================================================
--- branches/apricot/source/blender/include/BIF_resources.h	2008-05-19 13:34:43 UTC (rev 14896)
+++ branches/apricot/source/blender/include/BIF_resources.h	2008-05-19 14:16:18 UTC (rev 14897)
@@ -293,7 +293,7 @@
 	ICON_ARMATURE_DEHLT,
 	ICON_SNAP_GEAR,
 	ICON_SNAP_GEO,
-	ICON_BLANK41,
+	ICON_SNAP_NORMAL,
 	ICON_BLANK42,
 	
 	ICON_SMOOTHCURVE,

Modified: branches/apricot/source/blender/include/transform.h
===================================================================
--- branches/apricot/source/blender/include/transform.h	2008-05-19 13:34:43 UTC (rev 14896)
+++ branches/apricot/source/blender/include/transform.h	2008-05-19 14:16:18 UTC (rev 14897)
@@ -76,6 +76,8 @@
 	int  	status;
 	float	snapPoint[3];
 	float	snapTarget[3];
+	float	snapNormal[3];
+	float	snapTangent[3];
 	float	dist; // Distance from snapPoint to snapTarget
 	double	last;
 	void  (*applySnap)(struct TransInfo *, float *);
@@ -462,6 +464,7 @@
 void resetSnapping(TransInfo *t);
 int  handleSnapping(TransInfo *t, int event);
 void drawSnapping(TransInfo *t);
+int useSnappingNormal(TransInfo *t);
 
 /*********************** Generics ********************************/
 
@@ -492,6 +495,7 @@
 void calculatePropRatio(TransInfo *t);
 
 void getViewVector(float coord[3], float vec[3]);
+void getViewRay(short mval[2], float p[3], float d[3]);
 
 TransInfo * BIF_GetTransInfo(void);
 

Modified: branches/apricot/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_scene_types.h	2008-05-19 13:34:43 UTC (rev 14896)
+++ branches/apricot/source/blender/makesdna/DNA_scene_types.h	2008-05-19 14:16:18 UTC (rev 14897)
@@ -543,8 +543,8 @@
 	ListBase markers;
 	ListBase transform_spaces;
 	
-	short jumpframe, pad1;
-	short snap_flag, snap_target;
+	short jumpframe;
+	short snap_mode, snap_flag, snap_target;
 	
 	/* none of the dependancy graph  vars is mean to be saved */
 	struct  DagForest *theDag;
@@ -707,11 +707,16 @@
 
 /* scene->snap_flag */
 #define SCE_SNAP				1
+#define SCE_SNAP_ROTATE			2
 /* scene->snap_target */
 #define SCE_SNAP_TARGET_CLOSEST	0
 #define SCE_SNAP_TARGET_CENTER	1
 #define SCE_SNAP_TARGET_MEDIAN	2
 #define SCE_SNAP_TARGET_ACTIVE	3
+/* scene->snap_mode */
+#define SCE_SNAP_MODE_VERTEX	0
+#define SCE_SNAP_MODE_EDGE		1
+#define SCE_SNAP_MODE_FACE		2
 
 /* sce->selectmode */
 #define SCE_SELECT_VERTEX	1 /* for mesh */

Modified: branches/apricot/source/blender/src/blenderbuttons.c
===================================================================
--- branches/apricot/source/blender/src/blenderbuttons.c	2008-05-19 13:34:43 UTC (rev 14896)
+++ branches/apricot/source/blender/src/blenderbuttons.c	2008-05-19 14:16:18 UTC (rev 14897)
@@ -1,2165 +1,2181 @@
 /* DataToC output of file <blenderbuttons> */
 
-int datatoc_blenderbuttons_size= 69070;
+int datatoc_blenderbuttons_size= 69599;
 char datatoc_blenderbuttons[]= {
-137, 80, 78, 71, 13, 10, 26, 10,  0,  0,  0, 13, 73, 72,
- 68, 82,  0,  0,  2,  0,  0,  0,  1,  0,  8,  6,  0,  0,  0,197,144,206,103,  0,  0,  0,  6, 98, 75, 71, 68,  0,255,  0,255,  0,
-255,160,189,167,147,  0,  0,  0,  9,112, 72, 89,115,  0,  0, 11, 19,  0,  0, 11, 19,  1,  0,154,156, 24,  0,  0,  0,  7,116, 73,
- 77, 69,  7,216,  3, 21, 16,  3, 34,240,181, 88,200,  0,  0, 32,  0, 73, 68, 65, 84,120,218,236,125,121, 92, 84, 85,255,255,251,
-220,217,217,119, 84, 92, 64,197,125,197, 61,212,160,  7, 45,253,154,166,  2,102,182, 61,245,196,100,218,106,105, 86,207, 83,254,
-242,145,220, 90, 53, 29,159, 74,179,212, 18,212,180, 92, 18,116, 80, 67,114, 87, 44, 23, 20, 69,  4, 65,182, 97,102,152,253,206,
- 61,191, 63,102,134,134, 17,152,  5, 52,173,121,191,152, 23,115,239,220,249,204,185,247,156,243,121,127,150,179,144,  1,  3,  6,
- 80,120,225,133, 23, 94,120,225,133, 23,127, 43, 48,222, 71,224,133, 23, 94,120,225,133, 23,127, 31,156, 60,149, 13,  0, 32,222,
-  8,128, 23, 94,120,225,133, 23, 94,120, 35,  0, 94,120,225,133, 23, 94,120,225,133,215,  0,240,194, 11, 47,188,240,194, 11, 47,
-188,  6,128, 23, 94,120,225,133, 23, 94,120,241,151,  0,223,254, 96,230,204,153,196, 83, 65,171, 86,173,186,101, 44,129, 87,158,
- 87, 94, 51,160,171, 86,173,250,211,202,151,147,147, 67, 19, 18, 18,136,183, 62,238, 93,121,167, 79,159,246,184,241, 13, 24, 48,
-  0,222,250,240,202,251, 43,203,115,219,  0,248, 59, 67, 42,149, 54,120,128, 50,153,140,220,205,229, 92,189,122, 53,  8, 33,196,
- 91,115,158,213,241,244,233,211,145,153,153, 89,127,156,156,156,252,151,120,150,187,118,159,108, 86, 17,140, 31, 23,247,151,110,
- 51,146,224,109, 16,235,187, 34,  6, 70,212, 97, 55, 10,116,239,220,181,109,241,110,213, 49, 94,252, 77, 35,  0,119,162,177,238,
-218,181, 43, 97,251,246,237,114,219,241,164, 73,147, 18,199,143, 31,159,115, 55, 60, 12, 74, 45,186,243,110,229, 85,169, 84, 74,
-139,138,138,  0,  0,209,209,209,  0,112, 79, 40, 17, 71,227,202,106, 96, 53,233,153,187, 42,119,211,166, 77, 46, 27,106, 82,169,
-148,110,222,188,185,254,120,219,182,109, 24, 51,102, 76,253,113,102,102, 38,253,179,140,128, 65,131,  6, 81,  0, 56,113,226,  4,
-105,141,235,182,255, 32,107,198,  0,144,181,184,254,162, 98, 58,  0,  0,110,234,245, 96,117,  6,203,201, 90, 21,  0, 32, 37, 37,
-  5, 73, 73, 73, 77,150,111, 77,210, 26, 26, 91, 22,235,214,239, 39,254,158,232, 66,189, 72, 16,252,194, 89,232,183,111,131, 66,
- 49, 25, 10,  0,113,146,165,120, 71,114,  2, 29,196, 64,165,190, 16,239,232, 82,221,250,221,236,236,236,132,140,140, 12,185,253,
-185,148,148,148,196,164,164,164,156,187,169,111,181,150, 14,184, 23,238,247,118,224,189,183, 94, 34,126,130, 64, 98, 16, 11,169,
-161, 86,199,212,233, 84,220,135,159,174,248, 91,204,142,115,106,  0,236,218,181, 43,193,246,191,165, 68,109, 83, 36, 11, 54, 47,
-132, 95,135, 64,212, 93, 87,226,221,212,119,228,219,183,111,135,215, 26,118, 14,153, 76, 70,162,163,163,105, 81, 81, 17,138,138,
-138,176,103,207,158,187,214,147,176,213,181, 76, 38, 35, 50,153, 76, 32,149, 74, 77, 75,150, 44, 57,  6,  0,115,231,206, 29,210,
-220,119, 39, 79,158, 92,255,158,101,205, 48,154, 12, 48, 26,140, 48, 26, 45, 47,150,101, 49,119,238, 92,183,202, 98, 79,254,141,
- 97,204,152, 49,127,170, 17,224,138,241, 51,104,208, 32,167, 50,198,143,139, 35,158,144,188,203,  8, 10, 64,254,149,239, 32, 65,
-123,152,145,139,138, 47, 78,226, 76, 97, 53,166,124,176,214,165,175,199,150,197,186, 72,232, 22,200,123,203,157, 42, 98,201,248,
-119, 16, 50,233, 89,148,190, 18,  7,232, 20,245,231, 79,234,222,192, 73,  0,208,  1,163, 37, 41,216, 23,124,  2, 65,  0,  6, 41,
-  6,185,220,126, 29,145,145,145, 33,207,200,200,184, 43,244,149,173,140,173,161,  3,238,133,251,109,109,172, 95,185,138, 60, 30,
- 21,195,127, 41,249, 73, 94, 68,207, 40,134, 79, 34,136, 86,169,228,196,136, 52, 51,237,218,155,245, 55,174,154, 93,124,118, 55,
-220,208,225,237, 92,144, 55,199, 13,121,203,111,171,  1,176,125,251,118,249,230,127,191,133,212,247, 23,201,199,143, 31, 79, 90,
-210,192,108,196, 15,  0, 85,218,106, 32, 20,152,191,239, 61,168,174, 40, 32,125,238,238, 34,178,166, 58,196,159, 93, 70,123, 35,
-224,161,135, 30, 66, 81, 81, 17,162,163,163,239,186,103, 39,151, 91, 28,137,196,196, 68, 42,147,201, 24,153, 76, 22, 37,149, 74,
- 75,151, 44, 89,114,194, 85, 57, 44,203,194,104, 52,213, 19,191, 61,249, 31, 63,126, 28,131,  7, 15,118,171, 92,169,169,127,120,
-128,211,167, 79, 71, 86, 86, 86,  3,  3,160, 53,218,138, 39,245,112,226,196,  9,146,147,147, 67,199,142, 29,123,203,103,123,247,
-238,197,166, 77,155,234,143,155, 27,183,112,139,241,222,138,233,128,168,152, 14, 40, 85, 40,177,245,249,169,  8, 37,241, 40,252,
-223,235,232, 60,185, 51,178,220, 32,127, 27,210,210,210, 40,  0,172, 89,179,166,197,109, 54,106,115, 46,180,215,234, 80, 42,141,
-105,246,186,179,226,108, 44,232,123, 19,233,103,223,110, 81,125,182,  6,233,182,166,140,214,136,  4,220,238,251,109, 45,228,230,
-230,250,  0,184, 15,128,159,221,233, 90,  0,249,241,241,241, 53,174,202,209,113, 58,198, 88,101, 16,140,155, 56, 89,172,128, 73,
- 44, 16,240,249, 42,189,152, 17, 10,117, 28, 47,192,151, 53, 74, 76, 38,126,249, 13,131,152, 39,210,235,205,  6,179, 84, 42, 37,
-141,141, 25,177, 71,109,109,237,127,109,239, 11, 10, 10,170,124,125,125, 25,141, 70,195,217, 95, 51,116,232,208,143, 92, 45, 35,
-165,212, 41,177, 19, 66,230,180,244,153,242,157,121,255,221,186,117, 67,172, 95,  0, 90, 18,  5,176, 39,255, 42,109, 53,210,255,
-241, 94,253,103,255,220,254,  2, 16,  1, 76, 94,146,234, 86, 35,107,138,160, 91,139,164,175, 95,191, 14,  0,232,208,161, 67,131,
-247,182,223,117,214, 32,110,103,136,207,222,  8, 48,153, 88,172, 94,189,250,182,121,  1,238,202,116, 32,127,251,239,223,144,201,
-100,193, 82,169, 84,225, 50,249,155, 76, 48, 26, 13, 48, 24,141, 48, 57,144, 63,229,220,139,208,165,166,166,226,248,241,227,245,
-199,203,151, 47, 71,114,114,114,253,113,102,102,102,139,141, 29, 59,131,167,197,237,207,158,248,167, 79,159,142,129,  3,  7,122,
- 36,167,181,210,  1, 37, 87,138,161,217,246, 31,248, 61,243,  9,162, 98, 58, 32, 50, 84,130, 43,219,174, 88,200, 63, 40,192,146,
-  2, 16,240, 92,146,213, 26,196, 15,  0,221,206, 93,198,245,119, 23, 66,151,177,174,249,  8,129, 68,  2,189, 94,143,194,194, 66,
- 84,232, 47,162, 27,162,154,188, 54, 59, 59, 59,161,185,182, 47,147,201,136,173,159,100,103,103, 39,184, 19, 30,183,143,138,217,
-250,171,253, 57,119, 29,129,166,136,219, 29, 93,208,216,253,102,101,101, 81, 66,  8,146,146,146, 72, 75,238,215,134,103,159,125,
-150,126,249,229,151, 45,170,243,220,220,220, 64,  0,147,247,237,219,247, 31,142,227, 12,118, 36,200,231,241,120,190,  0,254, 21,
- 31, 31,191,203,153,156,130, 43,  5,124,137, 80, 44, 22,  8, 68,190, 12,159,  4, 80,158,200,135,227,241,248, 28, 97,192, 17,190,
-153,242,120,  6, 30, 71,244, 26,158, 89,235, 43, 20, 16, 94,151, 14,122,241,196,  8, 14,197,206,203,168, 80, 40, 84, 90,173,150,
-  5,  0,141, 70,195,189,245,214, 91,245,132,191,104,209,162, 87, 91,218,222,199,140, 25,243,188,237,125, 86, 86,214,234,214,232,
- 67,140, 51,239,127,225,180,100,232, 43, 43,241,122,239, 30,176,207,221,187,236,133, 88, 83,  8,246,228, 63,105,210,164, 68,153,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list