Hang with MovieStim.draw(): logic error in my script?

Hi,

First, if you’re doing habituation experiments with movie files, I might have a solution for you beyond this specific issue, which is that I’ve created a PsychoPy script designed to do exactly, precisely this, which I call PyHab (https://github.com/jfkominsky/PyHab). It uses MovieStim3, but it should be straightforward to replace its MovieStim3 with a MovieStim if you can’t get MovieStim3 working on your setup.

Second, for this specific issue, I think you’re probably right in general that it’s trying to draw a frame that is past the end of the movie file or otherwise one that does not exist. That probably has something to do with when the “finished” status is actually tripped, but I don’t know enough about moviestim statuses to be sure (I just calculate duration or num. frames and use that). I think something like this should side-step the issue:

def play(movie):
    if movie.status != visual.FINISHED:
        print 'drawing',
        movie.draw(win)
    print 'flipping',
    win.flip()
    return movie.status != visual.FINISHED

Failing that you might need to determine the number of frames in the movie and use that as a counter.