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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-10-10 08:54:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-10-10 08:54:02 +0400
commite4c38c5740809718a53d28ab87587f1b55d8ceda (patch)
tree8e8a3583e7b2ba9fde6caf5c5eecedf6d367d7cf /source
parent6e61448123b26d60099474405a6c585e1a7fae1a (diff)
changed python scn.Layers get/set to mask off bits other then (1<<20)-1
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Scene.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
index 8f013f66111..56ffa07bf25 100644
--- a/source/blender/python/api2_2x/Scene.c
+++ b/source/blender/python/api2_2x/Scene.c
@@ -285,7 +285,7 @@ static PyObject *Scene_getAttr( BPy_Scene * self, char *name )
attr = PyString_FromString( self->scene->id.name + 2 );
/* accept both Layer (for compatibility with ob.Layer) and Layers */
else if( strncmp( name, "Layer", 5 ) == 0 )
- attr = PyInt_FromLong( self->scene->lay );
+ attr = PyInt_FromLong( self->scene->lay & (1<<20)-1 );
/* Layers returns a bitmask, layers returns a list of integers */
else if( strcmp( name, "layers") == 0)
return Scene_getLayers(self);
@@ -677,7 +677,7 @@ static PyObject *Scene_setLayersMask(BPy_Scene *self, PyObject *args)
"expected an integer (bitmask) as argument" );
}
- if (laymask <= 0 || laymask > 2097151) /* binary: 1111 1111 1111 1111 1111 */
+ if (laymask <= 0 || laymask > (1<<20) - 1) /* binary: 1111 1111 1111 1111 1111 */
return EXPP_ReturnPyObjError( PyExc_AttributeError,
"bitmask must have from 1 up to 20 bits set");