Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2004-10-20 09:51:24 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2004-10-20 09:51:24 +0400
commitfa9135385a38c9289a2dfa2320c20b68d782c1e4 (patch)
treef011e964789f9d9c37f18dfc72de661a525ecf3c /source/blender/python/api2_2x/Image.c
parentf2f004af2df9733761cf9d4888e883a8c5f0d3e9 (diff)
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks); - added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos); - Blender.Image: added image.glFree() to free textures bound by the recently added image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can be used to load textures for scripts); - Blender.Sound: removed for now at least a few get/set methods of vars that can't be accessed via interface; - renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney pointed this some weeks ago, we should stick to one naming convention. - added documentation for Sound and Window.Theme modules and the other added functions, made other small updates. - Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix: after reading a discussion on blender.org's Python forum where eeshlo mentioned the pre 2.34 default was worldspace, I took a better look at Blender's relevant code, confirmed, talked to Theeth about this and as he suggested am changing the default back to 'worldspace'.
Diffstat (limited to 'source/blender/python/api2_2x/Image.c')
-rw-r--r--source/blender/python/api2_2x/Image.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c
index 02a2a47b8ba..ce70db0cf75 100644
--- a/source/blender/python/api2_2x/Image.c
+++ b/source/blender/python/api2_2x/Image.c
@@ -34,6 +34,7 @@
#include "BLI_winstuff.h"
#endif /* WIN32 */
+#include <BDR_drawmesh.h> /* free_realtime_image */
#include <BKE_main.h>
#include <BKE_global.h>
#include <BKE_library.h>
@@ -250,6 +251,7 @@ 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 ); /* by Campbell */
static PyObject *Image_glLoad( BPy_Image * self );
+static PyObject *Image_glFree( BPy_Image * self );
/*****************************************************************************/
/* Python BPy_Image methods table: */
@@ -275,6 +277,9 @@ static PyMethodDef BPy_Image_methods[] = {
{"glLoad", ( PyCFunction ) Image_glLoad, METH_NOARGS,
"() - Load the image data in OpenGL texture memory.\n\
The bindcode (int) is returned."},
+ {"glFree", ( PyCFunction ) Image_glFree, METH_NOARGS,
+ "() - Free the image data from OpenGL texture memory only,\n\
+ see also image.glLoad()."},
{"setName", ( PyCFunction ) Image_setName, METH_VARARGS,
"(str) - Change Image object name"},
{"setXRep", ( PyCFunction ) Image_setXRep, METH_VARARGS,
@@ -482,6 +487,14 @@ static PyObject *Image_reload( BPy_Image * self )
return Py_None;
}
+static PyObject *Image_glFree( BPy_Image * self )
+{
+ Image *img = self->image;
+
+ free_realtime_image( img );
+ return EXPP_incr_ret( Py_None );
+}
+
static PyObject *Image_glLoad( BPy_Image * self )
{
Image *img = self->image;