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:
authorCampbell Barton <ideasman42@gmail.com>2006-11-17 00:38:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2006-11-17 00:38:08 +0300
commit97d306e68f203573d50bf0d4d4651d6bbf5add19 (patch)
tree6e740f44fc772dddd14a146ee0c6a7690bf2a7ec /source/blender/python/api2_2x/Group.c
parent1a36a9080c16a3fc25d0349a04a626bd94cc80f8 (diff)
Added group.layers bitfield to the python API
Diffstat (limited to 'source/blender/python/api2_2x/Group.c')
-rwxr-xr-xsource/blender/python/api2_2x/Group.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c
index 2512d573661..71d41ef2ee3 100755
--- a/source/blender/python/api2_2x/Group.c
+++ b/source/blender/python/api2_2x/Group.c
@@ -253,6 +253,43 @@ static PyObject *Group_getUsers( BPy_Group * self )
return PyInt_FromLong( self->group->id.us );
}
+
+
+
+
+
+
+
+/*****************************************************************************/
+/* Python BPy_Group methods: */
+/*****************************************************************************/
+static int Group_setLayers( BPy_Group * self, PyObject * value )
+{
+ unsigned int laymask = 0;
+
+ GROUP_DEL_CHECK_INT(self);
+
+ if( !PyInt_CheckExact( value ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected an integer (bitmask) as argument" );
+
+ laymask = ( unsigned int )PyInt_AS_LONG( value );
+
+ if( laymask <= 0 )
+ return EXPP_ReturnIntError( PyExc_ValueError,
+ "layer value cannot be zero or below" );
+
+ self->group->layer= laymask & ((1<<20) - 1);
+
+ return 0;
+}
+
+static PyObject *Group_getLayers( BPy_Group * self )
+{
+ return PyInt_FromLong( self->group->layer );
+}
+
+
/*****************************************************************************/
/* Python attributes get/set structure: */
/*****************************************************************************/
@@ -265,6 +302,10 @@ static PyGetSetDef BPy_Group_getseters[] = {
(getter)Group_getUsers, (setter)NULL,
"Number of group users",
NULL},
+ {"layers",
+ (getter)Group_getLayers, (setter)Group_setLayers,
+ "Number of group users",
+ NULL},
{"objects",
(getter)Group_getObjects, (setter)Group_setObjects,
"objects in this group",
@@ -728,7 +769,6 @@ static PyObject *GroupObSeq_add( BPy_GroupObSeq * self, PyObject *args )
{
PyObject *pyobj;
Object *blen_ob;
- Base *base= NULL;
GROUP_DEL_CHECK_PY(self->bpygroup);