diff options
author | Ken Hughes <khughes@pacific.edu> | 2005-12-06 20:08:09 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2005-12-06 20:08:09 +0300 |
commit | 39ca3e3fa411e2a14bdfb71fe20823c8b85b775b (patch) | |
tree | 51839e8717d360aa33cf8d1e4208b9d628073ccc /source/blender/python/api2_2x/Material.c | |
parent | 1aebee2f9e8305b064477a0a9ca82a6e7cd54286 (diff) |
-- Bugfix #3548: material.setMode() was doing incorrect range check on
inputs, returned error setting RAYMIRROR or RAYTRANSP modes.
Diffstat (limited to 'source/blender/python/api2_2x/Material.c')
-rw-r--r-- | source/blender/python/api2_2x/Material.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index 50390025ee2..e0fe70b54f8 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -2938,6 +2938,34 @@ static PyObject *Matr_oldsetMode( BPy_Material * self, PyObject * args ) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + static int bitmask = MA_TRACEBLE + | MA_SHADOW + | MA_SHLESS + | MA_WIRE + | MA_VERTEXCOL + | MA_VERTEXCOLP + | MA_HALO + | MA_ZTRA + | MA_ZINV + | MA_HALO_RINGS + | MA_HALO_LINES + | MA_ONLYSHADOW + | MA_HALO_XALPHA + | MA_STAR + | MA_FACETEXTURE + | MA_HALOTEX + | MA_HALOPUNO + | MA_NOMIST + | MA_HALO_SHADE + | MA_HALO_FLARE + | MA_RADIO + | MA_RAYMIRROR + | MA_ZTRA + | MA_RAYTRANSP + | MA_ONLYSHADOW + | MA_NOMIST + | MA_ENV; + /* * check for a single integer argument; do a quick check for now @@ -2947,7 +2975,7 @@ static PyObject *Matr_oldsetMode( BPy_Material * self, PyObject * args ) if ( (PySequence_Size( args ) == 1) && PyInt_Check ( PyTuple_GET_ITEM ( args , 0 ) ) && PyArg_ParseTuple( args, "i", &flag ) - && flag < (MA_RAYMIRROR >> 1) ) { + && (flag & bitmask) == flag ) { ok = 1; /* |