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

Campbell Barton ideasman42 at gmail.com
Sun Jun 15 00:38:29 CEST 2008


Revision: 15228
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15228
Author:   campbellbarton
Date:     2008-06-15 00:37:33 +0200 (Sun, 15 Jun 2008)

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

Modified Paths:
--------------
    branches/apricot/intern/ghost/intern/GHOST_SystemX11.cpp
    branches/apricot/source/blender/blenkernel/BKE_scene.h
    branches/apricot/source/blender/src/view.c
    branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp

Modified: branches/apricot/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- branches/apricot/intern/ghost/intern/GHOST_SystemX11.cpp	2008-06-14 20:42:15 UTC (rev 15227)
+++ branches/apricot/intern/ghost/intern/GHOST_SystemX11.cpp	2008-06-14 22:37:33 UTC (rev 15228)
@@ -488,12 +488,12 @@
 					data.changed = 1;
 					data.delta = xcme.data.s[8] - data.time;
 					data.time = xcme.data.s[8];
-					data.tx = xcme.data.s[2];
-					data.ty = xcme.data.s[3];
-					data.tz = xcme.data.s[4];
+					data.tx = xcme.data.s[2] >> 2;
+					data.ty = xcme.data.s[3] >> 2;
+					data.tz = xcme.data.s[4] >> 2;
 					data.rx = xcme.data.s[5];
 					data.ry = xcme.data.s[6];
-					data.rz = xcme.data.s[7];
+					data.rz =-xcme.data.s[7];
 					g_event = new GHOST_EventNDOF(getMilliSeconds(),
 					                              GHOST_kEventNDOFMotion,
 					                              window, data);

Modified: branches/apricot/source/blender/blenkernel/BKE_scene.h
===================================================================
--- branches/apricot/source/blender/blenkernel/BKE_scene.h	2008-06-14 20:42:15 UTC (rev 15227)
+++ branches/apricot/source/blender/blenkernel/BKE_scene.h	2008-06-14 22:37:33 UTC (rev 15228)
@@ -53,7 +53,7 @@
 }
 
 /* note; doesn't work when scene is empty */
-#define SETLOOPER(s, b) sce= s, b= sce->base.first; b; b= (b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL)
+#define SETLOOPER(s, b) sce= s, b= (Base*)sce->base.first; b; b= (Base*)(b->next?b->next:sce->set?(sce=sce->set)->base.first:NULL)
 
 
 void free_avicodecdata(struct AviCodecData *acd);

Modified: branches/apricot/source/blender/src/view.c
===================================================================
--- branches/apricot/source/blender/src/view.c	2008-06-14 20:42:15 UTC (rev 15227)
+++ branches/apricot/source/blender/src/view.c	2008-06-14 22:37:33 UTC (rev 15228)
@@ -753,11 +753,12 @@
 
 
 	// Apply rotation
+	// Rotations feel relatively faster than translations only in fly mode, so
+	// we have no choice but to fix that here (not in the plugins)
+	rvec[0] = -0.5 * dval[3];
+	rvec[1] = -0.5 * dval[4];
+	rvec[2] = -0.5 * dval[5];
 
-	rvec[0] = -dval[3];
-	rvec[1] = -dval[4];
-	rvec[2] = dval[5];
-
 	// rotate device x and y by view z
 
 	Mat3CpyMat4(mat, G.vd->viewinv);
@@ -900,8 +901,7 @@
 		return;
 	}
 	
-		// dist correction from other movement devices
-		
+	// dist correction from other movement devices	
 	if((dz_flag)||G.vd->dist==0) {
 		dz_flag = 0;
 		G.vd->dist = m_dist;
@@ -1284,6 +1284,8 @@
     float reverse;
     float diff[4];
     float d, curareaX, curareaY;
+    float mat[3][3];
+    float upvec[3];
 
     /* Sensitivity will control how fast the view rotates.  The value was
      * obtained experimentally by tweaking until the author didn't get dizzy watching.
@@ -1304,6 +1306,16 @@
 		use_sel = 1;
 	}
 
+    if((dz_flag)||G.vd->dist==0) {
+		dz_flag = 0;
+		G.vd->dist = m_dist;
+		upvec[0] = upvec[1] = 0;
+		upvec[2] = G.vd->dist;
+		Mat3CpyMat4(mat, G.vd->viewinv);
+		Mat3MulVecfl(mat, upvec);
+		VecAddf(G.vd->ofs, G.vd->ofs, upvec);
+	}
+
     /*----------------------------------------------------
 	 * sometimes this routine is called from headerbuttons
      * viewmove needs to refresh the screen
@@ -1330,25 +1342,25 @@
 				filterNDOFvalues(fval);
 	
 	
-	// put scaling back here, was previously in ghostwinlay
-            fval[0] = fval[0]  * (1.0f/800.0f);
-            fval[1] = fval[1]  * (1.0f/800.0f);
-            fval[2] = fval[2] * (1.0f/800.0f);
-            fval[3] = fval[3]  * 0.00005f;
-            fval[4] = fval[4]  * 0.00005f;
-            fval[5] = fval[5] * 0.00005f;
-            fval[6] = fval[6]  / 1000000.0f;
+    // put scaling back here, was previously in ghostwinlay
+    fval[0] = fval[0] * (1.0f/1200.0f);
+    fval[1] = fval[1] * (1.0f/1200.0f);
+    fval[2] = fval[2] * (1.0f/1200.0f);
+    fval[3] = fval[3] * 0.00005f;
+    fval[4] =-fval[4] * 0.00005f;
+    fval[5] = fval[5] * 0.00005f;
+    fval[6] = fval[6] / 1000000.0f;
 			
-	// scale more if not in perspective mode
-			if (G.vd->persp == V3D_ORTHO) {
-				fval[0] = fval[0] * 0.05f;
-				fval[1] = fval[1] * 0.05f;
-				fval[2] = fval[2] * 0.05f;
-				fval[3] = fval[3] * 0.9f;
-				fval[4] = fval[4] * 0.9f;
-				fval[5] = fval[5] * 0.9f;
-				zsens *= 8;
-			}
+    // scale more if not in perspective mode
+    if (G.vd->persp == V3D_ORTHO) {
+        fval[0] = fval[0] * 0.05f;
+        fval[1] = fval[1] * 0.05f;
+        fval[2] = fval[2] * 0.05f;
+        fval[3] = fval[3] * 0.9f;
+        fval[4] = fval[4] * 0.9f;
+        fval[5] = fval[5] * 0.9f;
+        zsens *= 8;
+    }
 			
 	
     /* set object offset */

Modified: branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
===================================================================
--- branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp	2008-06-14 20:42:15 UTC (rev 15227)
+++ branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp	2008-06-14 22:37:33 UTC (rev 15228)
@@ -88,6 +88,7 @@
 #include "BKE_main.h"
 #include "BKE_global.h"
 #include "BKE_object.h"
+#include "BKE_scene.h"
 #include "BL_SkinMeshObject.h"
 #include "BL_SkinDeformer.h"
 #include "BL_MeshDeformer.h"
@@ -1809,6 +1810,9 @@
 {	
 
 	Scene *blenderscene = GetSceneForName(maggie, scenename);
+	// for SETLOOPER
+	Scene *sce;
+	Base *base;
 
 	// Get the frame settings of the canvas.
 	// Get the aspect ratio of the canvas as designed by the user.
@@ -1882,9 +1886,11 @@
 	}
 
 	SetDefaultFaceType(blenderscene);
-	
-	Base *base = static_cast<Base*>(blenderscene->base.first);
-	while(base)
+	// Let's support scene set.
+	// Beware of name conflict in linked data, it will not crash but will create confusion
+	// in Python scripting and in certain actuators (replace mesh). Linked scene *should* have
+	// no conflicting name for Object, Object data and Action.
+	for (SETLOOPER(blenderscene, base))
 	{
 		Object* blenderobject = base->object;
 		KX_GameObject* gameobj = gameobject_from_blenderobject(
@@ -2039,7 +2045,6 @@
 		if (gameobj)
 			gameobj->Release();
 
-		base = base->next;
 	}
 
 	if (blenderscene->camera) {
@@ -2049,7 +2054,7 @@
 	}
 
 	//	Set up armatures
-	for (base = static_cast<Base*>(blenderscene->base.first); base; base=base->next){
+	for(SETLOOPER(blenderscene, base)){
 		if (base->object->type==OB_MESH){
 			Mesh *me = (Mesh*)base->object->data;
 	





More information about the Bf-blender-cvs mailing list