==Python API==
added mipmap as an option for Blender.Get/Set
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: Blender.c 12702 2007-11-27 23:15:51Z campbellbarton $
|
* $Id$
|
||||||
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@@ -285,11 +285,23 @@ static PyObject *Blender_Set( PyObject * self, PyObject * args )
|
|||||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
"expected an integer" );
|
"expected an integer" );
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
U.flag |= USER_FILECOMPRESS;
|
U.flag |= USER_FILECOMPRESS;
|
||||||
else
|
else
|
||||||
U.flag &= ~USER_FILECOMPRESS;
|
U.flag &= ~USER_FILECOMPRESS;
|
||||||
|
} else if (StringEqual( name , "mipmap" ) ) {
|
||||||
|
int value = PyObject_IsTrue( arg );
|
||||||
|
|
||||||
|
if (value==-1)
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
|
"expected an integer" );
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
U.gameflags &= ~USER_DISABLE_MIPMAP;
|
||||||
|
else
|
||||||
|
U.gameflags |= USER_DISABLE_MIPMAP;
|
||||||
|
|
||||||
|
set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
|
||||||
}else
|
}else
|
||||||
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||||
"value given is not a blender setting" ) );
|
"value given is not a blender setting" ) );
|
||||||
@@ -521,14 +533,15 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
|||||||
|
|
||||||
else if(StringEqual( str, "compressfile" ))
|
else if(StringEqual( str, "compressfile" ))
|
||||||
ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15 );
|
ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15 );
|
||||||
|
else if(StringEqual( str, "mipmap" ))
|
||||||
|
ret = PyInt_FromLong( (U.gameflags & USER_DISABLE_MIPMAP) == 0 );
|
||||||
else
|
else
|
||||||
return EXPP_ReturnPyObjError( PyExc_AttributeError, "unknown attribute" );
|
return EXPP_ReturnPyObjError( PyExc_AttributeError, "unknown attribute" );
|
||||||
|
|
||||||
if (ret) return ret;
|
if (ret) return ret;
|
||||||
else
|
else
|
||||||
return EXPP_ReturnPyObjError (PyExc_MemoryError,
|
return EXPP_ReturnPyObjError (PyExc_MemoryError,
|
||||||
"could not create pystring!");
|
"could not create the PyObject!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@@ -69,6 +69,7 @@ def Set (request, data):
|
|||||||
- 'renderdir': default render output dir
|
- 'renderdir': default render output dir
|
||||||
- 'soundsdir': sound dir
|
- 'soundsdir': sound dir
|
||||||
- 'tempdir': temp file storage dir
|
- 'tempdir': temp file storage dir
|
||||||
|
- 'mipmap' : Use mipmapping in the 3d view (Use a boolean value True/False).
|
||||||
@type data: int or string
|
@type data: int or string
|
||||||
@param data: The new value.
|
@param data: The new value.
|
||||||
"""
|
"""
|
||||||
@@ -106,6 +107,7 @@ def Get (request):
|
|||||||
- 'soundsdir': the path to the user defined dir for sound files. (*)
|
- 'soundsdir': the path to the user defined dir for sound files. (*)
|
||||||
- 'tempdir': the path to the user defined dir for storage of Blender
|
- 'tempdir': the path to the user defined dir for storage of Blender
|
||||||
temporary files. (*)
|
temporary files. (*)
|
||||||
|
- 'mipmap' : Use mipmapping in the 3d view. (*)
|
||||||
- 'version' : the Blender version number.
|
- 'version' : the Blender version number.
|
||||||
@note: (*) these can be set in Blender at the User Preferences window -> File
|
@note: (*) these can be set in Blender at the User Preferences window -> File
|
||||||
Paths tab.
|
Paths tab.
|
||||||
|
Reference in New Issue
Block a user