bugfix
authorCampbell Barton <ideasman42@gmail.com>
Fri, 30 May 2008 01:59:15 +0000 (01:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 30 May 2008 01:59:15 +0000 (01:59 +0000)
* scene.object.context and scene.object.selected had broken get_item
funcs so scene.object.context[i]  returned the wrong object.
* aligning the view to an object (numpad*key), did not disable the
ortho view grid.
* long standing problem where opening a relative image would fail with
no message. BLI_convertstringcode was returning a path with /../../'s
that need to be cleaned before the path could be read, the path was also
invalid from unix shell so its not a blender path reading problem.

source/blender/blenlib/intern/util.c
source/blender/python/api2_2x/Scene.c
source/blender/src/view.c

index c85849b5ed4be35af35c35c406011801e8ef005f..3610813f2dac1be4c7023eee39356e772bee759b 100644 (file)
@@ -1166,6 +1166,7 @@ int BLI_convertstringcode(char *path, const char *basepath)
                MEM_freeN(filepart);
        }
        
+       BLI_cleanup_file(NULL, tmp);
        strcpy(path, tmp);
        
 #ifdef WIN32
index 7ef351b112751349d96ba610ceb716c927829ae2..eba951b88133b434ce0946e226fba18ae65ea9bb 100644 (file)
@@ -1355,16 +1355,29 @@ static PyObject *SceneObSeq_item( BPy_SceneObSeq * self, int i )
                for (base= scene->base.first; base && i!=index; base= base->next, index++) {}
        /* selected */
        else if (self->mode==EXPP_OBSEQ_SELECTED) {
-               for (base= scene->base.first; base && i!=index; base= base->next)
-                       if (base->flag & SELECT)
-                               index++;
+               for (base= scene->base.first; base; base= base->next) {
+                       if (base->flag & SELECT) {
+                               if (i==index) {
+                                       break;
+                               } else {
+                                       index++;
+                               }
+                       }
+               }
        }
        /* context */
        else if (self->mode==EXPP_OBSEQ_CONTEXT) {
-               if (G.vd)
-                       for (base= scene->base.first; base && i!=index; base= base->next)
-                               if TESTBASE(base)
-                                       index++;
+               if (G.vd) {
+                       for (base= scene->base.first; base; base= base->next) {
+                               if (TESTBASE(base)) {
+                                       if (i==index) {
+                                               break;
+                                       } else {
+                                               index++;
+                                       }
+                               }
+                       }
+               }
        }
        
        if (!(base))
index 2904ca60a124bb6b63dd40c542009c523bacf519..1e45f2bf3e049c334a84f102e517a76945a7fe86 100644 (file)
@@ -1448,6 +1448,8 @@ void obmat_to_viewmat(Object *ob, short smooth)
        float bmat[4][4];
        float tmat[3][3];
 
+       G.vd->view= 0; /* dont show the grid */
+
        Mat4CpyMat4(bmat, ob->obmat);
        Mat4Ortho(bmat);
        Mat4Invert(G.vd->viewmat, bmat);