diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-02-25 04:07:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-02-25 04:07:28 +0300 |
commit | 75147698e2b8765022097203b9bb1291a105f2d8 (patch) | |
tree | a74dc1f9874be70936a5faf73811c91e17ee99be /source/blender/python/api2_2x/Group.c | |
parent | f791672e76f90b360920c0d644d1f15f87dbd0e4 (diff) |
Scene
* Moved to getsetattrs
* added scene.users (get)
* added scene.fakeUser (get/set)
* added scene.world (get/set)
* added scene.timeline (get)
* added scene.render (get)
* added scene.radiosity (get)
* added scene.objects.camera (get/set)
Group
* added properties
gen_utils
* made getScriptLinks work as documented, return an empty list rather then None.
header files, noted libdata after PyObject as a requirement.
Others,
* Deprecate prints for older functionality
EpyDocs still need updating.
Diffstat (limited to 'source/blender/python/api2_2x/Group.c')
-rwxr-xr-x | source/blender/python/api2_2x/Group.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c index 4fb3a4c099b..413f069305f 100755 --- a/source/blender/python/api2_2x/Group.c +++ b/source/blender/python/api2_2x/Group.c @@ -214,6 +214,20 @@ static int Group_compare( BPy_Group * a, BPy_Group * b ); /*****************************************************************************/ /* Python BPy_Group methods: */ /*****************************************************************************/ +static PyObject *Group_getName( BPy_Group * self ) +{ + PyObject *attr; + GROUP_DEL_CHECK_PY(self); + + attr = PyString_FromString( self->group->id.name + 2 ); + + if( attr ) + return attr; + + return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, + "couldn't get Group.name attribute" ) ); +} + static int Group_setName( BPy_Group * self, PyObject * value ) { char *name = NULL; @@ -230,21 +244,6 @@ static int Group_setName( BPy_Group * self, PyObject * value ) return 0; } - -static PyObject *Group_getName( BPy_Group * self ) -{ - PyObject *attr; - GROUP_DEL_CHECK_PY(self); - - attr = PyString_FromString( self->group->id.name + 2 ); - - if( attr ) - return attr; - - return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Group.name attribute" ) ); -} - static PyObject *Group_getLib( BPy_Group * self ) { GROUP_DEL_CHECK_PY(self); @@ -273,6 +272,11 @@ static int Group_setFakeUser( BPy_Group * self, PyObject * value ) return SetIdFakeUser(&self->group->id, value); } +static PyObject *Group_getProperties( BPy_Group * self ) +{ + /*sanity check, we set parent property type to Group here*/ + return BPy_Wrap_IDProperty( (ID*)self->group, IDP_GetProperties((ID*)self->group, 1), NULL ); +} /*****************************************************************************/ @@ -325,6 +329,9 @@ static PyGetSetDef BPy_Group_getseters[] = { (getter)Group_getFakeUser, (setter)Group_setFakeUser, "Groups fake user state", NULL}, + {"properties", + (getter)Group_getProperties, NULL, + "get the ID properties associated with this group"}, {"layers", (getter)Group_getLayers, (setter)Group_setLayers, "Number of group users", |