BPython: bug fixes / patches from trackers
(excuse me for not committing earlier) Patches by Ken Hughes (thanks for all bug fixes!): 1) Setting a scene's MapOld and MapNew values in python does nothing: bug #2566 submitted by Dominic Agoro-Ombaka (dmao): https://projects.blender.org/tracker/?func=detail&aid=2566&group_id=9&atid=125 patch #2571: https://projects.blender.org/tracker/index.php?func=detail&aid=2571&group_id=9&atid=127 2) Calling the file selector after setting the progress bar crashes Blender: bug #2418 submitted by Alessandro Garosi (brandano): https://projects.blender.org/tracker/?func=detail&aid=2418&group_id=9&atid=125 patch #2568: https://projects.blender.org/tracker/index.php?func=detail&aid=2568&group_id=9&atid=127 3) Menus always generate same event when canceled: bug #2429 submitted by Campbell Barton: https://projects.blender.org/tracker/?func=detail&aid=2429&group_id=9&atid=125 patch #2579: https://projects.blender.org/tracker/?func=detail&aid=2579&group_id=9&atid=127 4) Add a vertex to a mesh with groups using a script and then edit that mesh hangs blender: bug #2211 reported by German Alonso Tamayo (servivo): https://projects.blender.org/tracker/index.php?func=detail&aid=2211&group_id=9&atid=125 patch #2580 #https://projects.blender.org/tracker/index.php?func=detail&aid=2580&group_id=9&atid=127 About bug #2033, I'm still looking at it, committing a small fix now. ===== Patches by Campbell Barton (thanks!): #2482: BGL pydocs fix broken links https://projects.blender.org/tracker/index.php?func=detail&aid=2482&group_id=9&atid=127 #2426: Large text in Draw.Text and Draw.GetStreingWidth https://projects.blender.org/tracker/index.php?func=detail&aid=2462&group_id=9&atid=127 #2521: scene.getActiveObject() https://projects.blender.org/tracker/index.php?func=detail&aid=2521&group_id=9&atid=127 #2523: NMesh.GetNames() https://projects.blender.org/tracker/index.php?func=detail&aid=2523&group_id=9&atid=127 - docs also updated
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
*
|
||||
* This is a new part of Blender.
|
||||
*
|
||||
* Contributor(s): Willian P. Germano, Campbell Barton
|
||||
* Contributor(s): Willian P. Germano, Campbell Barton, Ken Hughes
|
||||
*
|
||||
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||
*/
|
||||
@@ -538,10 +538,14 @@ void BPY_spacescript_do_pywin_event( SpaceScript * sc, unsigned short event,
|
||||
event = 0;
|
||||
|
||||
if( event == UI_BUT_EVENT ) {
|
||||
|
||||
if( menu_hack && ( val == 4 ) ) { /* "false" event? */
|
||||
menu_hack = 0; /* if so, discard it and clear menu_hack */
|
||||
} else {
|
||||
if( menu_hack && val == UI_RETURN_OK ) { /* "false" event? */
|
||||
if ( menu_hack == 2 ) /* was last event UI_RETURN_OUT? */
|
||||
spacescript_do_pywin_buttons( sc, UI_RETURN_OUT ); /* if so, send */
|
||||
menu_hack = 0; /* clear menu_hack */
|
||||
}
|
||||
else if( val == UI_RETURN_OUT ) /* possible cancel */
|
||||
menu_hack = 2;
|
||||
else {
|
||||
menu_hack = 1;
|
||||
spacescript_do_pywin_buttons( sc, val );
|
||||
}
|
||||
@@ -1076,13 +1080,15 @@ static PyObject *Method_GetStringWidth( PyObject * self, PyObject * args )
|
||||
|
||||
if( !strcmp( font_str, "normal" ) )
|
||||
font = ( &G )->font;
|
||||
else if( !strcmp( font_str, "large" ) )
|
||||
font = BMF_GetFont(BMF_kScreen15);
|
||||
else if( !strcmp( font_str, "small" ) )
|
||||
font = ( &G )->fonts;
|
||||
else if( !strcmp( font_str, "tiny" ) )
|
||||
font = ( &G )->fontss;
|
||||
else
|
||||
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"\"font\" must be: 'normal' (default), 'small' or 'tiny'." );
|
||||
"\"font\" must be: 'large', 'normal' (default), 'small' or 'tiny'." );
|
||||
|
||||
width = PyInt_FromLong( BMF_GetStringWidth( font, text ) );
|
||||
|
||||
@@ -1105,6 +1111,8 @@ static PyObject *Method_Text( PyObject * self, PyObject * args )
|
||||
|
||||
if( !font_str )
|
||||
font = ( &G )->font;
|
||||
else if( !strcmp( font_str, "large" ) )
|
||||
font = BMF_GetFont(BMF_kScreen15);
|
||||
else if( !strcmp( font_str, "normal" ) )
|
||||
font = ( &G )->font;
|
||||
else if( !strcmp( font_str, "small" ) )
|
||||
@@ -1113,7 +1121,7 @@ static PyObject *Method_Text( PyObject * self, PyObject * args )
|
||||
font = ( &G )->fontss;
|
||||
else
|
||||
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"\"font\" must be: 'normal' (default), 'small' or 'tiny'." );
|
||||
"\"font\" must be: 'normal' (default), 'large', 'small' or 'tiny'." );
|
||||
|
||||
BMF_DrawString( font, text );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user