diff options
author | Ton Roosendaal <ton@blender.org> | 2004-12-05 00:49:02 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-12-05 00:49:02 +0300 |
commit | aad31875d7224c58b1d94bd716bb5aab295fc8cb (patch) | |
tree | 8ef506c415f32ce8c5c5116c9f725f4369468852 /source/blender/python/api2_2x/Material.c | |
parent | 8d4782f7297c4a703b23b6b5383c0d76e4907903 (diff) |
Special bf-committers request; Lamp/World/Material now each have 10
channels to link texture to.
The amount of code changes seems large, but is mostly getting rind of
hardcoded values (6 and 8) for channels, replacing it with MAX_MTEX.
Further did some fixes;
- Ipo for Lamp showed too many mapping channels
- Texture MapTo buttons for lamp missed the slider to blend texture color
- Lamp texture mapping "View" only worked for Spot, now it uses lamp-
view vector for all types. (Nice for projections!)
Diffstat (limited to 'source/blender/python/api2_2x/Material.c')
-rw-r--r-- | source/blender/python/api2_2x/Material.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index 01e91cbb0b3..37c250b6c13 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -1146,11 +1146,11 @@ static PyObject *Material_getTextures( BPy_Material * self ) { int i; struct MTex *mtex; - PyObject *t[8]; + PyObject *t[MAX_MTEX]; PyObject *tuple; /* build a texture list */ - for( i = 0; i < 8; ++i ) { + for( i = 0; i < MAX_MTEX; ++i ) { mtex = self->material->mtex[i]; if( mtex ) { @@ -1805,10 +1805,10 @@ static PyObject *Material_setTexture( BPy_Material * self, PyObject * args ) if( !PyArg_ParseTuple( args, "iO!|ii", &texnum, &Texture_Type, &pytex, &texco, &mapto ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected int in [0,7] and Texture" ); - if( ( texnum < 0 ) || ( texnum >= 8 ) ) + "expected int in [0,9] and Texture" ); + if( ( texnum < 0 ) || ( texnum >= MAX_MTEX ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected int in [0,7] and Texture" ); + "expected int in [0,9] and Texture" ); bltex = Texture_FromPyObject( pytex ); @@ -1836,10 +1836,10 @@ static PyObject *Material_clearTexture( BPy_Material * self, PyObject * args ) if( !PyArg_ParseTuple( args, "i", &texnum ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected int in [0,7]" ); - if( ( texnum < 0 ) || ( texnum >= 8 ) ) + "expected int in [0,9]" ); + if( ( texnum < 0 ) || ( texnum >= MAX_MTEX ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected int in [0,7]" ); + "expected int in [0,9]" ); mtex = self->material->mtex[texnum]; if( mtex ) { |