diff options
-rw-r--r-- | source/blender/makesdna/DNA_texture_types.h | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Texture.c | 17 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Texture.py | 3 |
3 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 064cfe39d45..794d818d8fe 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -265,6 +265,7 @@ typedef struct TexMapping { #define TEX_PRV_NOR 64 #define TEX_REPEAT_XMIR 128 #define TEX_REPEAT_YMIR 256 +#define TEX_FLAG_MASK ( TEX_COLORBAND | TEX_FLIPBLEND | TEX_NEGALPHA | TEX_CHECKER_ODD | TEX_CHECKER_EVEN | TEX_PRV_ALPHA | TEX_PRV_NOR | TEX_REPEAT_XMIR | TEX_REPEAT_YMIR ) /* extend (starts with 1 because of backward comp.) */ #define TEX_EXTEND 1 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" ); diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py index 684897c8635..004cd2df274 100644 --- a/source/blender/python/api2_2x/doc/Texture.py +++ b/source/blender/python/api2_2x/doc/Texture.py @@ -60,6 +60,9 @@ Example:: - CHECKER_ODD - Fill the "odd" checkerboard tiles - CHECKER_EVEN - Fill the "even" checkerboard tiles - COLORBAND - Enable colorband for this texture + - PREVIEW_ALPHA - Show alpha in preview + - REPEAT_XMIR - Mirrors X direction repeat + - REPEAT_YMIR - Mirrors Y direction repeat @type ImageFlags: readonly dictionary @var ImageFlags: The available image flags for Texture.imageFlags: |