diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-02-23 17:51:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-02-23 17:51:20 +0300 |
commit | 086d51c822774ec68e95d9ab68679fb219ad8a12 (patch) | |
tree | 49591a038e005b8aaa7263668929d645dbfc8ca1 /source/blender/python/api2_2x/Image.c | |
parent | 260af5f3c1590900353cce62657536bc96d3f53b (diff) |
BPython API
* Added data.lib attributes to almost all data types, (except for Text3d and NLA)
This is None or the path of the library as a string.
* Main was giving a warning, Include Curve.h rather then CurNurb.h
* Added Library.LinkedLibs(), returns a list of externaly linked libs.
Diffstat (limited to 'source/blender/python/api2_2x/Image.c')
-rw-r--r-- | source/blender/python/api2_2x/Image.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index 20b8054dfed..a5b5642865d 100644 --- a/source/blender/python/api2_2x/Image.c +++ b/source/blender/python/api2_2x/Image.c @@ -1140,35 +1140,39 @@ static PyObject *Image_getAttr( BPy_Image * self, char *name ) else if( strcmp( name, "packed" ) == 0 ) { if (self->image->packedfile) attr = Py_True; else attr = Py_False; - EXPP_incr_ret(attr); + Py_INCREF(attr); } else if( strcmp( name, "has_data" ) == 0 ) { if (self->image->ibufs.first) attr = Py_True; else attr = Py_False; - EXPP_incr_ret(attr); + Py_INCREF(attr); } else if( strcmp( name, "fields" ) == 0 ) { if (self->image->flag & IMA_FIELDS) attr = Py_True; else attr = Py_False; - EXPP_incr_ret(attr); + Py_INCREF(attr); } else if( strcmp( name, "fields_odd" ) == 0 ) { if (self->image->flag & IMA_STD_FIELD) attr = Py_True; else attr = Py_False; - EXPP_incr_ret(attr); + Py_INCREF(attr); } else if( strcmp( name, "antialias" ) == 0 ) { if (self->image->flag & IMA_ANTIALI) attr = Py_True; else attr = Py_False; - EXPP_incr_ret(attr); - + Py_INCREF(attr); + } else if ( strcmp( name, "lib" ) == 0 ) { + /* WARNING - Not standard, until we move to get/setattrs + at the moment we cant return None at the end because it raises an error */ + attr = EXPP_GetIdLib((ID *)self->image); + if (attr) return attr; } else if( strcmp( name, "bindcode" ) == 0 ) attr = PyInt_FromLong( self->image->bindcode ); else if( strcmp( name, "users" ) == 0 ) attr = PyInt_FromLong( self->image->id.us ); else if( strcmp( name, "__members__" ) == 0 ) - attr = Py_BuildValue( "[s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s]", + attr = Py_BuildValue( "[s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s]", "name", "filename", "size", "depth", "xrep", "yrep", "start", "end", "speed", "packed", "has_data" "fields", "odd", "antialias", - "bindcode", "users" ); + "bindcode", "users", "lib" ); if( !attr ) return ( EXPP_ReturnPyObjError( PyExc_MemoryError, |