[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10904] branches/imgbrowser-elubie/source/ blender: === merge from trunk ===

Andrea Weikert elubie at gmx.net
Sat Jun 9 22:02:35 CEST 2007


Revision: 10904
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10904
Author:   elubie
Date:     2007-06-09 22:02:35 +0200 (Sat, 09 Jun 2007)

Log Message:
-----------
=== merge from trunk ===
changes from rev. 10897 to rev. 10903

Modified Paths:
--------------
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/CCGSubSurf.c
    branches/imgbrowser-elubie/source/blender/src/buttons_shading.c
    branches/imgbrowser-elubie/source/blender/src/editnla.c
    branches/imgbrowser-elubie/source/blender/src/editscreen.c

Modified: branches/imgbrowser-elubie/source/blender/blenkernel/intern/CCGSubSurf.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/blenkernel/intern/CCGSubSurf.c	2007-06-09 19:35:01 UTC (rev 10903)
+++ branches/imgbrowser-elubie/source/blender/blenkernel/intern/CCGSubSurf.c	2007-06-09 20:02:35 UTC (rev 10904)
@@ -483,20 +483,17 @@
 	_edge_free(e, ss);
 }
 
-static float EDGE_getSharpness(CCGEdge *e, int lvl, CCGSubSurf *ss) {
-	float sharpness = e->crease;
-	while (lvl--) {
-		if (sharpness>1.0) {
-			sharpness -= 1.0;
-		} else {
-			sharpness = 0.0;
-		}
-	}
-	return sharpness;
+static float EDGE_getSharpness(CCGEdge *e, int lvl) {
+	if (!lvl)
+		return e->crease;
+	else if (!e->crease)
+		return 0.0;
+	else if (e->crease - lvl < 0.0)
+		return 0.0;
+	else
+		return e->crease - lvl;
 }
 
-/***/
-
 static CCGFace *_face_new(CCGFaceHDL fHDL, CCGVert **verts, CCGEdge **edges, int numVerts, int levels, int dataSize, CCGSubSurf *ss) {
 	int maxGridSize = 1 + (1<<(ss->subdivLevels-1));
 	CCGFace *f = CCGSUBSURF_alloc(ss, sizeof(CCGFace) + sizeof(CCGVert*)*numVerts + sizeof(CCGEdge*)*numVerts + ss->meshIFC.vertDataSize *(1 + numVerts*maxGridSize + numVerts*maxGridSize*maxGridSize) + ss->meshIFC.faceUserSize);
@@ -1194,7 +1191,7 @@
 	for (ptrIdx=0; ptrIdx<numEffectedE; ptrIdx++) {
 		CCGEdge *e = effectedE[ptrIdx];
 		void *co = EDGE_getCo(e, nextLvl, 1);
-		float sharpness = EDGE_getSharpness(e, curLvl, ss);
+		float sharpness = EDGE_getSharpness(e, curLvl);
 
 		if (_edge_isBoundary(e) || sharpness>=1.0) {
 			VertDataCopy(co, VERT_getCo(e->v0, curLvl));
@@ -1233,7 +1230,7 @@
 
 		for (i=0; i<v->numEdges; i++) {
 			CCGEdge *e = v->edges[i];
-			float sharpness = EDGE_getSharpness(e, curLvl, ss);
+			float sharpness = EDGE_getSharpness(e, curLvl);
 
 			if (seam && _edge_isBoundary(e))
 				seamEdges++;
@@ -1307,7 +1304,7 @@
 
 			for (i=0; i<v->numEdges; i++) {
 				CCGEdge *e = v->edges[i];
-				float sharpness = EDGE_getSharpness(e, curLvl, ss);
+				float sharpness = EDGE_getSharpness(e, curLvl);
 
 				if (seam) {
 					if (_edge_isBoundary(e)) {
@@ -1472,7 +1469,7 @@
 			 */
 		for (ptrIdx=0; ptrIdx<numEffectedE; ptrIdx++) {
 			CCGEdge *e = (CCGEdge*) effectedE[ptrIdx];
-			float sharpness = EDGE_getSharpness(e, curLvl, ss);
+			float sharpness = EDGE_getSharpness(e, curLvl);
 
 			if (_edge_isBoundary(e) || sharpness>1.0) {
 				for (x=0; x<edgeSize-1; x++) {
@@ -1531,7 +1528,7 @@
 
 			for (i=0; i<v->numEdges; i++) {
 				CCGEdge *e = v->edges[i];
-				float sharpness = EDGE_getSharpness(e, curLvl, ss);
+				float sharpness = EDGE_getSharpness(e, curLvl);
 
 				if (seam && _edge_isBoundary(e))
 					seamEdges++;
@@ -1607,7 +1604,7 @@
 
 				for (i=0; i<v->numEdges; i++) {
 					CCGEdge *e = v->edges[i];
-					float sharpness = EDGE_getSharpness(e, curLvl, ss);
+					float sharpness = EDGE_getSharpness(e, curLvl);
 
 					if (seam) {
 						if (_edge_isBoundary(e))
@@ -1647,7 +1644,7 @@
 			 */
 		for (ptrIdx=0; ptrIdx<numEffectedE; ptrIdx++) {
 			CCGEdge *e = (CCGEdge*) effectedE[ptrIdx];
-			float sharpness = EDGE_getSharpness(e, curLvl, ss);
+			float sharpness = EDGE_getSharpness(e, curLvl);
 			int sharpCount = 0;
 			float avgSharpness = 0.0;
 

Modified: branches/imgbrowser-elubie/source/blender/src/buttons_shading.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/src/buttons_shading.c	2007-06-09 19:35:01 UTC (rev 10903)
+++ branches/imgbrowser-elubie/source/blender/src/buttons_shading.c	2007-06-09 20:02:35 UTC (rev 10904)
@@ -2475,7 +2475,7 @@
 	}
 	uiBlockEndAlign(block);
 	
-	uiDefButBitS(block, TOG, LA_ONLYSHADOW, B_NOP,"OnlyShadow",		10,110,80,19,&la->mode, 0, 0, 0, 0, "Causes light to cast shadows only without illuminating objects");
+	uiDefButBitS(block, TOG, LA_ONLYSHADOW, B_LAMPPRV,"OnlyShadow",		10,110,80,19,&la->mode, 0, 0, 0, 0, "Causes light to cast shadows only without illuminating objects");
 
 	if(la->type==LA_SPOT) {
 		uiBlockBeginAlign(block);

Modified: branches/imgbrowser-elubie/source/blender/src/editnla.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/src/editnla.c	2007-06-09 19:35:01 UTC (rev 10903)
+++ branches/imgbrowser-elubie/source/blender/src/editnla.c	2007-06-09 20:02:35 UTC (rev 10904)
@@ -395,9 +395,16 @@
 	bActionStrip *strip;
 	
 	for (base=G.scene->base.first; base; base=base->next) {
+		/* object has ipo - these keyframes should be able to be snapped, even if strips are collapsed */
+		if (base->object->ipo) {
+			snap_ipo_keys(base->object->ipo, snap_mode);
+		}
+		
+		/* object is collapsed - action and nla strips not shown/editable */
 		if (base->object->nlaflag & OB_NLA_COLLAPSED)
 			continue;
 		
+		/* snap action strips */
 		for (strip = base->object->nlastrips.last; strip; strip=strip->prev) {
 			if (strip->flag & ACTSTRIP_SELECT) {
 				if (snap_mode==1) {
@@ -422,11 +429,6 @@
 			}
 		}
 		
-		/* object has ipo */
-		if (base->object->ipo) {
-			snap_ipo_keys(base->object->ipo, snap_mode);
-		}
-		
 		/* object has action */
 		if (base->object->action) {
 			ListBase act_data = {NULL, NULL};

Modified: branches/imgbrowser-elubie/source/blender/src/editscreen.c
===================================================================
--- branches/imgbrowser-elubie/source/blender/src/editscreen.c	2007-06-09 19:35:01 UTC (rev 10903)
+++ branches/imgbrowser-elubie/source/blender/src/editscreen.c	2007-06-09 20:02:35 UTC (rev 10904)
@@ -1405,10 +1405,10 @@
 				bScreen *sc= G.curscreen->id.next;
 
 				/* if screen is last, set it to first */
-				if(sc == NULL)
+				if(sc == NULL) 
 					sc= G.main->screen.first;
 				
-				setscreen(sc);
+				if(is_allowed_to_change_screen(sc)) setscreen(sc);
 				g_activearea= NULL;
 				towin= 0;
 			}
@@ -1418,10 +1418,10 @@
 				bScreen *sc= G.curscreen->id.prev;
 				
 				/* if screen is first, set it to last */
-				if(sc == NULL)
+				if(sc == NULL) 
 					sc= G.main->screen.last;
 				
-				setscreen(sc);
+				if(is_allowed_to_change_screen(sc)) setscreen(sc);
 				g_activearea= NULL;
 				towin= 0;
 			}





More information about the Bf-blender-cvs mailing list