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:
authorYann Vernier <yann@algonet.se>2005-01-23 19:32:51 +0300
committerYann Vernier <yann@algonet.se>2005-01-23 19:32:51 +0300
commit8d0ef2163d774cf4271d87c981bf0b25be7ab256 (patch)
tree48797571be366d430057700624253e75029063a1 /source/blender/python/api2_2x/Texture.c
parent413e4f51a638b9af2fe669e399d7219afdbdb932 (diff)
This should make the Texture stype attribute work for EnvMaps.
Diffstat (limited to 'source/blender/python/api2_2x/Texture.c')
-rw-r--r--source/blender/python/api2_2x/Texture.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c
index fe0fc1dacca..562f53f8f16 100644
--- a/source/blender/python/api2_2x/Texture.c
+++ b/source/blender/python/api2_2x/Texture.c
@@ -915,9 +915,14 @@ static PyObject *Texture_getSType( BPy_Texture * self )
{
PyObject *attr = NULL;
const char *stype = NULL;
+ int n_stype;
+ if( self->texture->type == EXPP_TEX_TYPE_ENVMAP )
+ n_stype = self->texture->env->stype;
+ else
+ n_stype = self->texture->stype;
if( EXPP_map_getStrVal( tex_stype_map[self->texture->type],
- self->texture->stype, &stype ) )
+ n_stype, &stype ) )
attr = PyString_FromString( stype );
if( !attr )
@@ -1449,6 +1454,9 @@ static PyObject *Texture_setSType( BPy_Texture * self, PyObject * args )
EXPP_map_getShortVal( tex_stype_map
[EXPP_TEX_TYPE_DISTNOISE], stype,
&self->texture->noisebasis ) ) );
+ else if( ( self->texture->type == EXPP_TEX_TYPE_ENVMAP &&
+ EXPP_map_getShortVal( tex_stype_map[self->texture->type],
+ stype, &self->texture->env->stype ) ) );
else if( !EXPP_map_getShortVal
( tex_stype_map[self->texture->type], stype,
&self->texture->stype ) )
@@ -1475,7 +1483,10 @@ static PyObject *Texture_setIntSType( BPy_Texture * self, PyObject * args )
return EXPP_ReturnPyObjError( PyExc_ValueError,
"invalid stype (for this type)" );
- self->texture->stype = stype;
+ if( self->texture->type == EXPP_TEX_TYPE_ENVMAP )
+ self->texture->env->stype = stype;
+ else
+ self->texture->stype = stype;
Py_INCREF( Py_None );
return Py_None;
@@ -1780,7 +1791,10 @@ static PyObject *Texture_getAttr( BPy_Texture * self, char *name )
attr = Py_BuildValue( "(f,f,f)", tex->rfac, tex->gfac,
tex->gfac );
else if( STREQ( name, "stype" ) )
- attr = PyInt_FromLong( tex->stype );
+ if( self->texture->type == EXPP_TEX_TYPE_ENVMAP )
+ attr = PyInt_FromLong( tex->env->stype );
+ else
+ attr = PyInt_FromLong( tex->stype );
else if( STREQ( name, "turbulence" ) )
attr = PyFloat_FromDouble( tex->turbul );
else if( STREQ( name, "type" ) )