diff options
author | Joseph Eagar <joeedh@gmail.com> | 2006-11-19 19:00:04 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2006-11-19 19:00:04 +0300 |
commit | 6e086d4cfe88a62e0ec7f6e1a6731c0685896078 (patch) | |
tree | 3b481fa3c66bd7795c57fe1c5155e4e9ecea8192 /source/blender/python/api2_2x/Texture.c | |
parent | b861f9b9a61952c80774e5fa41b0be1b543684cb (diff) |
=ID Properties Python Update=
ID Properties binding have now been added for textures. Also,
the beginnings of supporting "del IDProperty Object" (which
basically removes the property from it's parent group then frees
it) in python were done; really the only thing now is to figure
out exactly *how* you overload the del operator. :S
Diffstat (limited to 'source/blender/python/api2_2x/Texture.c')
-rw-r--r-- | source/blender/python/api2_2x/Texture.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 30fbc22214a..1e2588ea43e 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -33,17 +33,22 @@ #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_idprop.h" #include "BKE_library.h" -#include "BLI_blenlib.h" #include "BKE_texture.h" #include "BKE_utildefines.h" + +#include "BLI_blenlib.h" + #include "DNA_object_types.h" #include "DNA_material_types.h" #include "DNA_scene_types.h" #include "DNA_texture_types.h" + #include "MTex.h" #include "Image.h" #include "Ipo.h" +#include "IDProp.h" #include "constant.h" #include "blendef.h" #include "gen_utils.h" @@ -397,6 +402,7 @@ GETFUNC( clearIpo ); GETFUNC( oldgetSType ); GETFUNC( oldgetType ); +GETFUNC(getProperties); GETFUNC( clearIpo ); GETFUNC( getAnimFrames ); GETFUNC( getAnimLength ); @@ -539,6 +545,9 @@ static PyMethodDef BPy_Texture_methods[] = { /* Python Texture_Type attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef BPy_Texture_getseters[] = { + {"properties", + (getter)Texture_getProperties, NULL, + "Get this texture's ID Properties"}, {"animFrames", (getter)Texture_getAnimFrames, (setter)Texture_setAnimFrames, "Number of frames of a movie to use", @@ -1324,6 +1333,12 @@ int Texture_CheckPyObject( PyObject * pyobj ) /* Python BPy_Texture methods: */ /*****************************************************************************/ +static PyObject *Texture_getProperties( BPy_Texture * self ) +{ + /*sanity check, we set parent property type to Group here*/ + return BPy_Wrap_IDProperty( (ID*)self->texture, IDP_GetProperties((ID*)self->texture, 1), NULL ); +} + static PyObject *Texture_getExtend( BPy_Texture * self ) { PyObject *attr = NULL; |