[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15165] branches/apricot/source: svn merge -r15150:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender/

Campbell Barton ideasman42 at gmail.com
Sun Jun 8 22:43:24 CEST 2008


Revision: 15165
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15165
Author:   campbellbarton
Date:     2008-06-08 22:43:22 +0200 (Sun, 08 Jun 2008)

Log Message:
-----------
svn  merge  -r15150:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--------------
    branches/apricot/source/blender/render/intern/source/convertblender.c
    branches/apricot/source/blender/src/buttons_editing.c
    branches/apricot/source/blender/src/buttons_object.c
    branches/apricot/source/blender/src/drawipo.c
    branches/apricot/source/blender/src/drawview.c
    branches/apricot/source/gameengine/Ketsji/KX_RayCast.cpp

Modified: branches/apricot/source/blender/render/intern/source/convertblender.c
===================================================================
--- branches/apricot/source/blender/render/intern/source/convertblender.c	2008-06-08 20:12:29 UTC (rev 15164)
+++ branches/apricot/source/blender/render/intern/source/convertblender.c	2008-06-08 20:43:22 UTC (rev 15165)
@@ -3935,9 +3935,60 @@
 	}
 }
 
-static void check_non_flat_quads(ObjectRen *obr, int quad_flip)
+/* split quads for pradictable baking
+ * dir 1 == (0,1,2) (0,2,3),  2 == (1,3,0) (1,2,3) 
+ */
+static void split_quads(ObjectRen *obr, int dir) 
 {
 	VlakRen *vlr, *vlr1;
+	int a;
+
+	for(a=obr->totvlak-1; a>=0; a--) {
+		vlr= RE_findOrAddVlak(obr, a);
+		
+		/* test if rendering as a quad or triangle, skip wire */
+		if(vlr->v4 && (vlr->flag & R_STRAND)==0 && (vlr->mat->mode & MA_WIRE)==0) {
+			
+			if(vlr->v4) {
+
+				vlr1= RE_vlakren_copy(obr, vlr);
+				vlr1->flag |= R_FACE_SPLIT;
+				
+				if( dir==2 ) vlr->flag |= R_DIVIDE_24;
+				else vlr->flag &= ~R_DIVIDE_24;
+
+				/* new vertex pointers */
+				if (vlr->flag & R_DIVIDE_24) {
+					vlr1->v1= vlr->v2;
+					vlr1->v2= vlr->v3;
+					vlr1->v3= vlr->v4;
+
+					vlr->v3 = vlr->v4;
+					
+					vlr1->flag |= R_DIVIDE_24;
+				}
+				else {
+					vlr1->v1= vlr->v1;
+					vlr1->v2= vlr->v3;
+					vlr1->v3= vlr->v4;
+					
+					vlr1->flag &= ~R_DIVIDE_24;
+				}
+				vlr->v4 = vlr1->v4 = NULL;
+				
+				/* new normals */
+				CalcNormFloat(vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n);
+				CalcNormFloat(vlr1->v3->co, vlr1->v2->co, vlr1->v1->co, vlr1->n);
+			}
+			/* clear the flag when not divided */
+			else vlr->flag &= ~R_DIVIDE_24;
+		}
+	}
+}
+
+static void check_non_flat_quads(ObjectRen *obr)
+{
+	VlakRen *vlr, *vlr1;
 	VertRen *v1, *v2, *v3, *v4;
 	float nor[3], xn, flen;
 	int a;
@@ -4003,22 +4054,16 @@
 					vlr1= RE_vlakren_copy(obr, vlr);
 					vlr1->flag |= R_FACE_SPLIT;
 					
-					if (quad_flip==0) { /* nonzero quad_flip is used to force dividing one way */
-						/* split direction based on vnorms */
-						CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, nor);
-						d1= nor[0]*vlr->v1->n[0] + nor[1]*vlr->v1->n[1] + nor[2]*vlr->v1->n[2];
+					/* split direction based on vnorms */
+					CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, nor);
+					d1= nor[0]*vlr->v1->n[0] + nor[1]*vlr->v1->n[1] + nor[2]*vlr->v1->n[2];
 
-						CalcNormFloat(vlr->v2->co, vlr->v3->co, vlr->v4->co, nor);
-						d2= nor[0]*vlr->v2->n[0] + nor[1]*vlr->v2->n[1] + nor[2]*vlr->v2->n[2];
-					
-						if( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24;
-						else vlr->flag &= ~R_DIVIDE_24;
-					} else if (quad_flip==1) {
-						vlr->flag &= ~R_DIVIDE_24;
-					} else { /* quad_flip == 3 */
-						vlr->flag |= R_DIVIDE_24;
-					}
-					
+					CalcNormFloat(vlr->v2->co, vlr->v3->co, vlr->v4->co, nor);
+					d2= nor[0]*vlr->v2->n[0] + nor[1]*vlr->v2->n[1] + nor[2]*vlr->v2->n[2];
+				
+					if( fabs(d1) < fabs(d2) ) vlr->flag |= R_DIVIDE_24;
+					else vlr->flag &= ~R_DIVIDE_24;
+
 					/* new vertex pointers */
 					if (vlr->flag & R_DIVIDE_24) {
 						vlr1->v1= vlr->v2;
@@ -4072,11 +4117,11 @@
 			if((re->r.mode & R_RAYTRACE) && (re->r.mode & R_SHADOW)) 
 				set_phong_threshold(obr);
 			
-			if (re->flag & R_BAKING) {
+			if (re->flag & R_BAKING && re->r.bake_quad_split != 0) {
 				/* Baking lets us define a quad split order */
-				check_non_flat_quads(obr, re->r.bake_quad_split);
+				split_quads(obr, re->r.bake_quad_split);
 			} else {
-				check_non_flat_quads(obr, 0);
+				check_non_flat_quads(obr);
 			}
 			
 			set_fullsample_flag(re, obr);

Modified: branches/apricot/source/blender/src/buttons_editing.c
===================================================================
--- branches/apricot/source/blender/src/buttons_editing.c	2008-06-08 20:12:29 UTC (rev 15164)
+++ branches/apricot/source/blender/src/buttons_editing.c	2008-06-08 20:43:22 UTC (rev 15165)
@@ -4369,7 +4369,7 @@
 			
 			/* bone types */
 			uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge",		-10,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone");
-			uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S",		70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone");
+			uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S",		70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone");
 			uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform",	90, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry");
 			uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup");
 			uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide",	250,by-38,80,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode");

Modified: branches/apricot/source/blender/src/buttons_object.c
===================================================================
--- branches/apricot/source/blender/src/buttons_object.c	2008-06-08 20:12:29 UTC (rev 15164)
+++ branches/apricot/source/blender/src/buttons_object.c	2008-06-08 20:43:22 UTC (rev 15165)
@@ -4057,7 +4057,7 @@
 				uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Aero:",     30,10,60,20, &sb->aeroedge,  0.00,  30000.0, 10, 0, "Make edges 'sail'");
 			    uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Plas:", 90,10,60,20, &sb->plastic, 0.0,  100.0, 10, 0, "Permanent deform");
 				if(ob->type==OB_MESH) {
-					uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0,  10.0, 10, 0, "Bendig Stiffness");
+					uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0,  10.0, 10, 0, "Bending Stiffness");
 					if (*softflag & OB_SB_QUADS){ 
 					uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Sh:", 230,10,80,20, &sb->shearstiff, 0.0,  1.0, 10, 0, "Shear Stiffness");
 					}

Modified: branches/apricot/source/blender/src/drawipo.c
===================================================================
--- branches/apricot/source/blender/src/drawipo.c	2008-06-08 20:12:29 UTC (rev 15164)
+++ branches/apricot/source/blender/src/drawipo.c	2008-06-08 20:43:22 UTC (rev 15165)
@@ -1712,7 +1712,7 @@
 /* is used for both read and write... */
 static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float max)
 {
-	Object *ob= OBACT;
+	Object *ob;
 	EditIpo *ei;
 	BezTriple *bezt;
 	float median[3];
@@ -1721,6 +1721,12 @@
 	median[0]= median[1]= median[2]= 0.0;
 	tot= 0;
 	
+	/* use G.sipo->from (which should be an object) so that pinning ipo's will still work ok */
+	if((G.sipo->from) && (GS(G.sipo->from->name) == ID_OB))
+		ob= (Object *)(G.sipo->from);
+	else
+		ob= OBACT;
+	
 	ei= G.sipo->editipo;
 	for(a=0; a<G.sipo->totipo; a++, ei++) {
 		

Modified: branches/apricot/source/blender/src/drawview.c
===================================================================
--- branches/apricot/source/blender/src/drawview.c	2008-06-08 20:12:29 UTC (rev 15164)
+++ branches/apricot/source/blender/src/drawview.c	2008-06-08 20:43:22 UTC (rev 15165)
@@ -2154,6 +2154,7 @@
 			}
 			allqueue(REDRAWVIEW3D, 1);
 			allqueue(REDRAWBUTSOBJECT, 0);
+			allqueue(REDRAWOOPS, 0);
 		}
 		break;
 		

Modified: branches/apricot/source/gameengine/Ketsji/KX_RayCast.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_RayCast.cpp	2008-06-08 20:12:29 UTC (rev 15164)
+++ branches/apricot/source/gameengine/Ketsji/KX_RayCast.cpp	2008-06-08 20:43:22 UTC (rev 15165)
@@ -29,6 +29,7 @@
  */
 
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "KX_RayCast.h"
 





More information about the Bf-blender-cvs mailing list