[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60471] branches/soc-2013-depsgraph_mt: Merging r60468 through r60470 from trunk into soc-2013-depsgraph_mt

Sergey Sharybin sergey.vfx at gmail.com
Tue Oct 1 10:27:02 CEST 2013


Revision: 60471
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60471
Author:   nazgul
Date:     2013-10-01 08:27:02 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Merging r60468 through r60470 from trunk into soc-2013-depsgraph_mt

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60468
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60470

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_curve.h
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_fcurve.h
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/curve.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/fcurve.c
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/node.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/animation/keyframes_edit.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_view3d/view3d_buttons.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_view3d/view3d_snap.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/transform/transform_conversions.c

Property Changed:
----------------
    branches/soc-2013-depsgraph_mt/
    branches/soc-2013-depsgraph_mt/source/blender/editors/interface/interface.c
    branches/soc-2013-depsgraph_mt/source/blender/editors/space_outliner/


Property changes on: branches/soc-2013-depsgraph_mt
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-60467
   + /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032,59214,59220,59251,59601
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57395-60470

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_curve.h
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_curve.h	2013-10-01 08:19:31 UTC (rev 60470)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_curve.h	2013-10-01 08:27:02 UTC (rev 60471)
@@ -155,6 +155,7 @@
 
 void BKE_nurb_handles_calc(struct Nurb *nu);
 void BKE_nurb_handles_autocalc(struct Nurb *nu, int flag);
-void BKE_nurb_handles_test(struct Nurb *nu);
+void BKE_nurb_bezt_handle_test(struct BezTriple *bezt, const bool use_handle);
+void BKE_nurb_handles_test(struct Nurb *nu, const bool use_handles);
 
 #endif  /* __BKE_CURVE_H__ */

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_fcurve.h
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_fcurve.h	2013-10-01 08:19:31 UTC (rev 60470)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/BKE_fcurve.h	2013-10-01 08:27:02 UTC (rev 60471)
@@ -234,7 +234,7 @@
 /* -------- Curve Sanity --------  */
 
 void calchandles_fcurve(struct FCurve *fcu);
-void testhandles_fcurve(struct FCurve *fcu, const short use_handle);
+void testhandles_fcurve(struct FCurve *fcu, const bool use_handle);
 void sort_time_fcurve(struct FCurve *fcu);
 short test_time_fcurve(struct FCurve *fcu);
 

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/curve.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/curve.c	2013-10-01 08:19:31 UTC (rev 60470)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/curve.c	2013-10-01 08:27:02 UTC (rev 60471)
@@ -3132,46 +3132,67 @@
 	}
 }
 
-void BKE_nurb_handles_test(Nurb *nu)
+/**
+ * Use when something has changed handle positions.
+ *
+ * The caller needs to recalculate handles.
+ */
+void BKE_nurb_bezt_handle_test(BezTriple *bezt, const bool use_handle)
 {
-	/* use when something has changed with handles.
-	 * it treats all BezTriples with the following rules:
-	 * PHASE 1: do types have to be altered?
-	 *    Auto handles: become aligned when selection status is NOT(000 || 111)
-	 *    Vector handles: become 'nothing' when (one half selected AND other not)
-	 * PHASE 2: recalculate handles
-	 */
-	BezTriple *bezt;
-	short flag, a;
+	short flag = 0;
 
-	if (nu->type != CU_BEZIER) return;
+#define SEL_F1 (1 << 0)
+#define SEL_F2 (1 << 1)
+#define SEL_F3 (1 << 2)
 
-	bezt = nu->bezt;
-	a = nu->pntsu;
-	while (a--) {
-		flag = 0;
-		if (bezt->f1 & SELECT)
-			flag++;
-		if (bezt->f2 & SELECT)
-			flag += 2;
-		if (bezt->f3 & SELECT)
-			flag += 4;
+	if (use_handle) {
+		if (bezt->f1 & SELECT) flag |= SEL_F1;
+		if (bezt->f2 & SELECT) flag |= SEL_F2;
+		if (bezt->f3 & SELECT) flag |= SEL_F3;
+	}
+	else {
+		flag = (bezt->f2 & SELECT) ? (SEL_F1 | SEL_F2 | SEL_F3) : 0;
+	}
 
-		if (!(flag == 0 || flag == 7) ) {
-			if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) {   /* auto */
-				bezt->h1 = HD_ALIGN;
-			}
-			if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {   /* auto */
-				bezt->h2 = HD_ALIGN;
-			}
+	/* check for partial selection */
+	if (!ELEM(flag, 0, SEL_F1 | SEL_F2 | SEL_F3)) {
+		if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM)) {
+			bezt->h1 = HD_ALIGN;
+		}
+		if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) {
+			bezt->h2 = HD_ALIGN;
+		}
 
-			if (bezt->h1 == HD_VECT) {   /* vector */
-				if (flag < 4) bezt->h1 = 0;
+		if (bezt->h1 == HD_VECT) {
+			if ((!(flag & SEL_F1)) != (!(flag & SEL_F2))) {
+				bezt->h1 = HD_FREE;
 			}
-			if (bezt->h2 == HD_VECT) {   /* vector */
-				if (flag > 3) bezt->h2 = 0;
+		}
+		if (bezt->h2 == HD_VECT) {
+			if ((!(flag & SEL_F3)) != (!(flag & SEL_F2))) {
+				bezt->h2 = HD_FREE;
 			}
 		}
+	}
+
+#undef SEL_F1
+#undef SEL_F2
+#undef SEL_F3
+
+}
+
+void BKE_nurb_handles_test(Nurb *nu, const bool use_handle)
+{
+	BezTriple *bezt;
+	short a;
+
+	if (nu->type != CU_BEZIER)
+		return;
+
+	bezt = nu->bezt;
+	a = nu->pntsu;
+	while (a--) {
+		BKE_nurb_bezt_handle_test(bezt, use_handle);
 		bezt++;
 	}
 
@@ -3198,7 +3219,7 @@
 
 		/* left handle: */
 		if (flag == 0 || (bezt1->f1 & flag) ) {
-			bezt1->h1 = 0;
+			bezt1->h1 = HD_FREE;
 			/* distance too short: vectorhandle */
 			if (len_v3v3(bezt1->vec[1], bezt0->vec[1]) < 0.0001f) {
 				bezt1->h1 = HD_VECT;
@@ -3217,7 +3238,7 @@
 		}
 		/* right handle: */
 		if (flag == 0 || (bezt1->f3 & flag) ) {
-			bezt1->h2 = 0;
+			bezt1->h2 = HD_FREE;
 			/* distance too short: vectorhandle */
 			if (len_v3v3(bezt1->vec[1], bezt2->vec[1]) < 0.0001f) {
 				bezt1->h2 = HD_VECT;
@@ -3233,15 +3254,15 @@
 			}
 		}
 		if (leftsmall && bezt1->h2 == HD_ALIGN)
-			bezt1->h2 = 0;
+			bezt1->h2 = HD_FREE;
 		if (rightsmall && bezt1->h1 == HD_ALIGN)
-			bezt1->h1 = 0;
+			bezt1->h1 = HD_FREE;
 
 		/* undesired combination: */
 		if (bezt1->h1 == HD_ALIGN && bezt1->h2 == HD_VECT)
-			bezt1->h1 = 0;
+			bezt1->h1 = HD_FREE;
 		if (bezt1->h2 == HD_ALIGN && bezt1->h1 == HD_VECT)
-			bezt1->h2 = 0;
+			bezt1->h2 = HD_FREE;
 
 		bezt0 = bezt1;
 		bezt1 = bezt2;

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/fcurve.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/fcurve.c	2013-10-01 08:19:31 UTC (rev 60470)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/fcurve.c	2013-10-01 08:27:02 UTC (rev 60471)
@@ -841,14 +841,7 @@
 	}
 }
 
-/* Use when F-Curve with handles has changed
- * It treats all BezTriples with the following rules:
- *  - PHASE 1: do types have to be altered?
- *      -> Auto handles: become aligned when selection status is NOT(000 || 111)
- *      -> Vector handles: become 'nothing' when (one half selected AND other not)
- *  - PHASE 2: recalculate handles
- */
-void testhandles_fcurve(FCurve *fcu, const short use_handle)
+void testhandles_fcurve(FCurve *fcu, const bool use_handle)
 {
 	BezTriple *bezt;
 	unsigned int a;
@@ -856,45 +849,10 @@
 	/* only beztriples have handles (bpoints don't though) */
 	if (ELEM(NULL, fcu, fcu->bezt))
 		return;
-	
+
 	/* loop over beztriples */
 	for (a = 0, bezt = fcu->bezt; a < fcu->totvert; a++, bezt++) {
-		short flag = 0;
-		
-		/* flag is initialized as selection status
-		 * of beztriple control-points (labelled 0, 1, 2)
-		 */
-		if (bezt->f2 & SELECT) flag |= (1 << 1);  // == 2
-		if (use_handle == FALSE) {
-			if (flag & 2) {
-				flag |= (1 << 0) | (1 << 2);
-			}
-		}
-		else {
-			if (bezt->f1 & SELECT) flag |= (1 << 0);  // == 1
-			if (bezt->f3 & SELECT) flag |= (1 << 2);  // == 4
-		}
-		
-		/* one or two handles selected only */
-		if (ELEM(flag, 0, 7) == 0) {
-			/* auto handles become aligned */
-			if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM))
-				bezt->h1 = HD_ALIGN;
-			if (ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM))
-				bezt->h2 = HD_ALIGN;
-			
-			/* vector handles become 'free' when only one half selected */
-			if (bezt->h1 == HD_VECT) {
-				/* only left half (1 or 2 or 1+2) */
-				if (flag < 4) 
-					bezt->h1 = 0;
-			}
-			if (bezt->h2 == HD_VECT) {
-				/* only right half (4 or 2+4) */
-				if (flag > 3) 
-					bezt->h2 = 0;
-			}
-		}
+		BKE_nurb_bezt_handle_test(bezt, use_handle);
 	}
 
 	/* recalculate handles */

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/node.c	2013-10-01 08:19:31 UTC (rev 60470)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/node.c	2013-10-01 08:27:02 UTC (rev 60471)
@@ -1933,7 +1933,13 @@
 		 * Note: previews are not copied here.
 		 */
 		ltree = ntreeCopyTree_internal(ntree, FALSE, FALSE, FALSE);
-	
+		
+		for (node = ltree->nodes.first; node; node = node->next) {
+			if (node->type == NODE_GROUP && node->id) {
+				node->id = (ID *)ntreeLocalize((bNodeTree *)node->id);
+			}
+		}
+		
 		if (adt) {
 			AnimData *ladt = BKE_animdata_from_id(&ltree->id);
 	
@@ -1978,10 +1984,24 @@
 /* we have to assume the editor already changed completely */
 void ntreeLocalMerge(bNodeTree *localtree, bNodeTree *ntree)
 {
-	if (localtree && ntree) {
-		if (ntree->typeinfo->local_merge)
-			ntree->typeinfo->local_merge(localtree, ntree);
+	bNode *node;
+	
+	if (localtree) {
+		if (ntree) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list