Revision: 15237
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15237
Author:   bdiego
Date:     2008-06-15 23:02:42 +0200 (Sun, 15 Jun 2008)

Log Message:
-----------
branches/blender-2.47

Merge from trunk:
        Revision: 15211
        Revision: 15219
        Revision: 15225
        Revision: 15230
        Revision: 15234

Modified Paths:
--------------
    branches/blender-2.47/intern/ghost/intern/GHOST_SystemX11.cpp
    branches/blender-2.47/source/blender/blenkernel/intern/object.c
    branches/blender-2.47/source/blender/src/buttons_editing.c
    branches/blender-2.47/source/blender/src/drawaction.c
    branches/blender-2.47/source/blender/src/usiblender.c
    branches/blender-2.47/source/blender/src/view.c

Modified: branches/blender-2.47/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- branches/blender-2.47/intern/ghost/intern/GHOST_SystemX11.cpp       
2008-06-15 17:55:23 UTC (rev 15236)
+++ branches/blender-2.47/intern/ghost/intern/GHOST_SystemX11.cpp       
2008-06-15 21:02:42 UTC (rev 15237)
@@ -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/blender-2.47/source/blender/blenkernel/intern/object.c
===================================================================
--- branches/blender-2.47/source/blender/blenkernel/intern/object.c     
2008-06-15 17:55:23 UTC (rev 15236)
+++ branches/blender-2.47/source/blender/blenkernel/intern/object.c     
2008-06-15 21:02:42 UTC (rev 15237)
@@ -1100,6 +1100,8 @@
 {
        bPoseChannel *chan;
        
+       /* note: need to clear obn->pose pointer first, so that copy_pose works 
(otherwise there's a crash) */
+       obn->pose= NULL;
        copy_pose(&obn->pose, ob->pose, 1);     /* 1 = copy constraints */
 
        for (chan = obn->pose->chanbase.first; chan; chan=chan->next){

Modified: branches/blender-2.47/source/blender/src/buttons_editing.c
===================================================================
--- branches/blender-2.47/source/blender/src/buttons_editing.c  2008-06-15 
17:55:23 UTC (rev 15236)
+++ branches/blender-2.47/source/blender/src/buttons_editing.c  2008-06-15 
21:02:42 UTC (rev 15237)
@@ -2402,7 +2402,7 @@
                                but= uiDefBut(block, BUT, B_MODIFIER_RECALC, 
"Bind", lx,(cy-=24), buttonWidth,19, 0, 0, 0, 0, 0, "Bind mesh to cage");
                                
uiButSetFunc(but,modifiers_bindMeshDeform,ob,md);
                                uiDefButS(block, NUM, B_NOP, "Precision:", 
lx,(cy-19), buttonWidth/2 + 20,19, &mmd->gridsize, 2, 10, 0.5, 0, "The grid 
size for binding");
-                               uiDefButBitS(block, TOG, MOD_MDEF_DYNAMIC_BIND, 
B_MODIFIER_RECALC, "Dynamic", lx+(buttonWidth+1)/2 + 20, (cy-=19), 
buttonWidth/2 - 20,19, &mmd->flag, 0.0, 31.0, 0, 0, "Invert vertex group 
influence");
+                               uiDefButBitS(block, TOG, MOD_MDEF_DYNAMIC_BIND, 
B_MODIFIER_RECALC, "Dynamic", lx+(buttonWidth+1)/2 + 20, (cy-=19), 
buttonWidth/2 - 20,19, &mmd->flag, 0.0, 31.0, 0, 0, "Recompute binding 
dynamically on top of other deformers like Shape Keys (slower and more memory 
consuming!)");
                        }
                        uiBlockEndAlign(block);
                } else if (md->type==eModifierType_ParticleSystem) {

Modified: branches/blender-2.47/source/blender/src/drawaction.c
===================================================================
--- branches/blender-2.47/source/blender/src/drawaction.c       2008-06-15 
17:55:23 UTC (rev 15236)
+++ branches/blender-2.47/source/blender/src/drawaction.c       2008-06-15 
21:02:42 UTC (rev 15237)
@@ -730,7 +730,7 @@
                
                for (achan=saction->action->chanbase.first; achan; 
achan=achan->next) {
                        pchan= get_pose_channel(ob->pose, achan->name);
-                       if (pchan) {
+                       if (pchan && pchan->bone) {
                                if ((pchan->bone->layer & arm->layer)==0)
                                        achan->flag |= ACHAN_HIDDEN;
                                else if (pchan->bone->flag & BONE_HIDDEN_P)

Modified: branches/blender-2.47/source/blender/src/usiblender.c
===================================================================
--- branches/blender-2.47/source/blender/src/usiblender.c       2008-06-15 
17:55:23 UTC (rev 15236)
+++ branches/blender-2.47/source/blender/src/usiblender.c       2008-06-15 
21:02:42 UTC (rev 15237)
@@ -925,7 +925,7 @@
 
                writeBlog();
        } else {
-               error("%s", err);
+               error("failed to write blend file: %s", err);
        }
 
        waitcursor(0);
@@ -940,7 +940,10 @@
                
        /*  force save as regular blend file */
        write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | 
G_FILE_SIGN);
-       BLO_write_file(tstr, write_flags, &err);
+       
+       if (!BLO_write_file(tstr, write_flags, &err)) {
+               error("failed writing defaults: %s", err);
+       }
 }
 
 void BIF_write_autosave(void)
@@ -952,7 +955,9 @@
 
                /*  force save as regular blend file */
        write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | 
G_FILE_SIGN);
-       BLO_write_file(tstr, write_flags, &err);
+       if (!BLO_write_file(tstr, write_flags, &err)) {
+               fprintf(stderr, "failed to write autosave: %s\n", err); /* 
using error(...) is too annoying here */
+       }
 }
 
 /* remove temp files assosiated with this blend file when quitting, loading or 
saving in a new path */

Modified: branches/blender-2.47/source/blender/src/view.c
===================================================================
--- branches/blender-2.47/source/blender/src/view.c     2008-06-15 17:55:23 UTC 
(rev 15236)
+++ branches/blender-2.47/source/blender/src/view.c     2008-06-15 21:02:42 UTC 
(rev 15237)
@@ -711,11 +711,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);
@@ -782,8 +783,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;
@@ -1124,6 +1124,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.
@@ -1144,6 +1146,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
@@ -1170,25 +1182,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 */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to