diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-11-27 21:32:26 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-11-27 21:32:26 +0300 |
commit | e3b7dfe6e2cf4d1d7faf32d287b02c01939dc3e6 (patch) | |
tree | 3a6922ea4b0ca5f2c3414eb28d428f0640b23091 /source/blender/python/BPY_interface.c | |
parent | fa5649796d2deb94eefff92d2e1132de3dc5e339 (diff) |
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).
Diffstat (limited to 'source/blender/python/BPY_interface.c')
-rw-r--r-- | source/blender/python/BPY_interface.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 1fd217656d9..bc691e002fb 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -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: |