Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/python/BPY_interface.c6
-rw-r--r--source/blender/python/api2_2x/Material.c5
-rw-r--r--source/blender/python/api2_2x/NMesh.c5
3 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c
index ee318ddaca7..5f978b2e8d6 100644
--- a/source/blender/python/BPY_interface.c
+++ b/source/blender/python/BPY_interface.c
@@ -997,7 +997,11 @@ int BPY_has_onload_script( void )
void BPY_do_pyscript( ID * id, short event )
{
- ScriptLink *scriptlink = ID_getScriptlink( id );
+ ScriptLink *scriptlink;
+
+ if( !id ) return;
+
+ scriptlink = ID_getScriptlink( id );
if( scriptlink && scriptlink->totscript ) {
PyObject *dict;
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c
index 833bd16a008..01e91cbb0b3 100644
--- a/source/blender/python/api2_2x/Material.c
+++ b/source/blender/python/api2_2x/Material.c
@@ -25,7 +25,8 @@
*
* This is a new part of Blender.
*
- * Contributor(s): Willian P. Germano, Michel Selten, Alex Mole
+ * Contributor(s): Willian P. Germano, Michel Selten, Alex Mole,
+ * Alexander Szakaly
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
@@ -2194,6 +2195,8 @@ Material **EXPP_newMaterialList_fromPyList( PyObject * list )
len = PySequence_Length( list );
if( len > 16 )
len = 16;
+ else if( len <= 0 )
+ return NULL;
matlist = EXPP_newMaterialList( len );
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c
index 38d189e007f..f08882ebcc1 100644
--- a/source/blender/python/api2_2x/NMesh.c
+++ b/source/blender/python/api2_2x/NMesh.c
@@ -26,7 +26,7 @@
* This is a new part of Blender.
*
* Contributor(s): Willian P. Germano, Jordi Rovira i Bonet, Joseph Gilbert,
- * Bala Gi
+ * Bala Gi, Alexander Szakaly
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
@@ -2045,6 +2045,7 @@ void EXPP_unlink_mesh( Mesh * me )
me->mat[a]->id.us--;
me->mat[a] = 0;
}
+
/* ... here we want to preserve mesh keys */
/* if users want to get rid of them, they can use mesh.removeAllKeys() */
/*
@@ -2053,6 +2054,8 @@ void EXPP_unlink_mesh( Mesh * me )
*/
if( me->texcomesh )
me->texcomesh = 0;
+
+ me->totcol = 0;
}
static int unlink_existingMeshData( Mesh * mesh )