diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-05-30 05:59:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-05-30 05:59:15 +0400 |
commit | da2d4904af51507fc211a0101f8e33306135e76a (patch) | |
tree | 9d1ebfecb33182bd90b14f2c811f487bcfc0bba4 /source/blender/python | |
parent | 6af06ecdd2b748507e3dad41055fdf41253b7493 (diff) |
bugfix
* 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.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/api2_2x/Scene.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index 7ef351b1127..eba951b8813 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -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)) |