Index: source/blender/python/api2_2x/Image.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Image.c,v retrieving revision 1.15 diff -u -r1.15 Image.c --- source/blender/python/api2_2x/Image.c 23 Nov 2003 17:46:05 -0000 1.15 +++ source/blender/python/api2_2x/Image.c 25 May 2004 02:43:42 -0000 @@ -233,6 +233,7 @@ static PyObject *Image_setName(BPy_Image *self, PyObject *args); static PyObject *Image_setXRep(BPy_Image *self, PyObject *args); static PyObject *Image_setYRep(BPy_Image *self, PyObject *args); +static PyObject *Image_reload(BPy_Image *self); /*****************************************************************************/ /* Python BPy_Image methods table: */ @@ -251,6 +252,8 @@ "() - Return Image object x repetition value"}, {"getYRep", (PyCFunction)Image_getYRep, METH_NOARGS, "() - Return Image object y repetition value"}, + {"reload", (PyCFunction)Image_reload, METH_NOARGS, + "() - Reload the image from the filesystem"}, {"setName", (PyCFunction)Image_setName, METH_VARARGS, "(str) - Change Image object name"}, {"setXRep", (PyCFunction)Image_setXRep, METH_VARARGS, @@ -428,6 +431,19 @@ return EXPP_ReturnPyObjError (PyExc_RuntimeError, "couldn't get Image.yrep attribute"); +} + +static PyObject *Image_reload(BPy_Image *self) +{ + Image *img; + img = self->image; + + free_image_buffers(img); + img->ok= 1; + image_changed(G.sima, 0); + + Py_INCREF(Py_None); + return Py_None; } static PyObject *Image_setName(BPy_Image *self, PyObject *args) Index: source/blender/python/api2_2x/doc/Image.py =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Image.py,v retrieving revision 1.2 diff -u -r1.2 Image.py --- source/blender/python/api2_2x/doc/Image.py 30 Jul 2003 21:15:37 -0000 1.2 +++ source/blender/python/api2_2x/doc/Image.py 25 May 2004 02:43:43 -0000 @@ -105,6 +105,13 @@ @rtype: int """ + def reload(): + """ + Reloads this image from the filesystem, if used within a loop you need to redraw the Window + to see the change in the image eg. Window.RedrawAll() + If the image is corrupt or in the process of saving, the image will be replaced by a blank image but no error will be returned. + """ + def setName(name): """ Set the name of this Image object.