BPython:
- fixed bug #1882: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1882&group_id=9 Crash / hang when changing meshes that had edge data. The mesh->totedge value was not being set to 0. Reported by jms, thanks. - fixed bug #1780: https://projects.blender.org/tracker/index.php?func=detail&aid=1780&group_id=9&atid=125. Deleting a Text that was being used as script link crashed Blender. Added a check to unlink the Text from eventual script links when it gets removed. Reported by kaito, thanks. - doc updates (one related to bug #1807: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1807&group_id=9 , actually a little misleading word in the NMesh doc: you can get the subsurfed mesh with NMesh.GetRawFromObject, but it's the display subdivision level that counts).
This commit is contained in:
@@ -1091,6 +1091,46 @@ void BPY_free_scriptlink( struct ScriptLink *slink )
|
||||
return;
|
||||
}
|
||||
|
||||
int CheckAllScriptsFromList( ListBase * list, Text * text )
|
||||
{
|
||||
ID *id;
|
||||
ScriptLink *scriptlink;
|
||||
int index;
|
||||
int fixed = 0;
|
||||
|
||||
id = list->first;
|
||||
|
||||
while( id != NULL ) {
|
||||
scriptlink = ID_getScriptlink( id );
|
||||
if( scriptlink && scriptlink->totscript ) {
|
||||
for( index = 0; index < scriptlink->totscript; index++) {
|
||||
if ((Text *)scriptlink->scripts[index] == text) {
|
||||
scriptlink->scripts[index] = NULL;
|
||||
fixed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
id = id->next;
|
||||
}
|
||||
|
||||
return fixed;
|
||||
}
|
||||
|
||||
/* When a Text is deleted, we need to unlink it from eventual scriptlinks */
|
||||
int BPY_check_all_scriptlinks( Text * text )
|
||||
{
|
||||
int fixed = 0;
|
||||
fixed += CheckAllScriptsFromList( &( G.main->object ), text );
|
||||
fixed += CheckAllScriptsFromList( &( G.main->lamp ), text );
|
||||
fixed += CheckAllScriptsFromList( &( G.main->camera ), text );
|
||||
fixed += CheckAllScriptsFromList( &( G.main->mat ), text );
|
||||
fixed += CheckAllScriptsFromList( &( G.main->world ), text );
|
||||
fixed += CheckAllScriptsFromList( &( G.main->scene ), text );
|
||||
|
||||
return fixed;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Description:
|
||||
* Notes:
|
||||
|
||||
Reference in New Issue
Block a user