diff options
author | Ken Hughes <khughes@pacific.edu> | 2007-09-22 00:46:17 +0400 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2007-09-22 00:46:17 +0400 |
commit | 2244d19bc2ad65e9dca261a41f95501886a429fd (patch) | |
tree | a360c7cdbb0a8bed6f709d26dcbfcf2f8eea204c /source/blender/python/api2_2x/Texture.c | |
parent | 641fc64eb32311b712856d64413191fb16c5972d (diff) |
Python API
----------
Bgfix #7386: added support for texture flags TEX_PRV_ALPHA, TEX_REPEAT_XMIR and
TEX_REPEAT_YMIR to tex.flags attribute.
Diffstat (limited to 'source/blender/python/api2_2x/Texture.c')
-rw-r--r-- | source/blender/python/api2_2x/Texture.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 2f2443eef88..34906757ebd 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -203,11 +203,14 @@ static const EXPP_map_pair tex_type_map[] = { static const EXPP_map_pair tex_flag_map[] = { /* NOTE "CheckerOdd" and "CheckerEven" are new */ - {"ColorBand", TEX_COLORBAND }, + {"ColorBand", TEX_COLORBAND }, {"FlipBlend", TEX_FLIPBLEND}, {"NegAlpha", TEX_NEGALPHA}, {"CheckerOdd",TEX_CHECKER_ODD}, {"CheckerEven",TEX_CHECKER_EVEN}, + {"PreviewAlpha",TEX_PRV_ALPHA}, + {"RepeatXMirror",TEX_REPEAT_XMIR}, + {"RepeatYMirror",TEX_REPEAT_YMIR}, {NULL, 0} }; @@ -1162,6 +1165,9 @@ static PyObject *M_Texture_FlagsDict( void ) PyConstant_Insert(d, "NEGALPHA", PyInt_FromLong(TEX_NEGALPHA)); PyConstant_Insert(d, "CHECKER_ODD", PyInt_FromLong(TEX_CHECKER_ODD)); PyConstant_Insert(d, "CHECKER_EVEN", PyInt_FromLong(TEX_CHECKER_EVEN)); + PyConstant_Insert(d, "PREVIEW_ALPHA", PyInt_FromLong(TEX_PRV_ALPHA)); + PyConstant_Insert(d, "REPEAT_XMIR", PyInt_FromLong(TEX_REPEAT_XMIR)); + PyConstant_Insert(d, "REPEAT_YMIR", PyInt_FromLong(TEX_REPEAT_YMIR)); } return Flags; } @@ -1528,20 +1534,15 @@ static int Texture_setFilterSize( BPy_Texture * self, PyObject * value ) static int Texture_setFlags( BPy_Texture * self, PyObject * value ) { int param; - int bitmask = TEX_FLIPBLEND - | TEX_COLORBAND - | TEX_NEGALPHA - | TEX_CHECKER_ODD - | TEX_CHECKER_EVEN; if( !PyInt_Check( value ) ) { char errstr[128]; - sprintf ( errstr , "expected int bitmask of 0x%08x", bitmask ); + sprintf ( errstr , "expected int bitmask of 0x%08x", TEX_FLAG_MASK ); return EXPP_ReturnIntError( PyExc_TypeError, errstr ); } param = PyInt_AS_LONG ( value ); - if ( ( param & bitmask ) != param ) + if ( ( param & TEX_FLAG_MASK ) != param ) return EXPP_ReturnIntError( PyExc_ValueError, "invalid bit(s) set in mask" ); |