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/Lattice.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/Lattice.c')
-rw-r--r-- | source/blender/python/api2_2x/Lattice.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Lattice.c b/source/blender/python/api2_2x/Lattice.c index 0837773b8a2..c0551034eb8 100644 --- a/source/blender/python/api2_2x/Lattice.c +++ b/source/blender/python/api2_2x/Lattice.c @@ -747,7 +747,12 @@ static PyObject *Lattice_getAttr( BPy_Lattice * self, char *name ) if( strcmp( name, "name" ) == 0 ) attr = PyString_FromString( self->Lattice->id.name + 2 ); - else if( strcmp( name, "width" ) == 0 ) + 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->Lattice); + if (attr) return attr; + } else if( strcmp( name, "width" ) == 0 ) attr = PyInt_FromLong( self->Lattice->pntsu ); else if( strcmp( name, "height" ) == 0 ) attr = PyInt_FromLong( self->Lattice->pntsv ); @@ -800,10 +805,10 @@ static PyObject *Lattice_getAttr( BPy_Lattice * self, char *name ) } else if( strcmp( name, "key" ) == 0 ) { return Lattice_getKey(self); } else if( strcmp( name, "__members__" ) == 0 ) - attr = Py_BuildValue( "[s,s,s,s,s,s,s,s,s,s]", "name", "width", + attr = Py_BuildValue( "[s,s,s,s,s,s,s,s,s,s,s]", "name", "width", "height", "depth", "widthType", "heightType", "depthType", "mode", - "latSize", "users", "key" ); + "latSize", "users", "key", "lib" ); if( !attr ) return ( EXPP_ReturnPyObjError( PyExc_MemoryError, |