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:
authorKen Hughes <khughes@pacific.edu>2005-12-06 20:08:09 +0300
committerKen Hughes <khughes@pacific.edu>2005-12-06 20:08:09 +0300
commit39ca3e3fa411e2a14bdfb71fe20823c8b85b775b (patch)
tree51839e8717d360aa33cf8d1e4208b9d628073ccc /source/blender/python/api2_2x/Material.c
parent1aebee2f9e8305b064477a0a9ca82a6e7cd54286 (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.c30
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;
/*