Fixes in bpython:
-- Alexander Szakaly reported and provided a patch for Material.c and NMesh.c to solve crash in material handling when there's no material. -- Ton reported a crash with advancing a frame after creating a new script link. I couldn't reproduce the crash, but added a check in BPY_do_pyscript to make sure the passed ID pointer is valid. Thanks both.
This commit is contained in:
@@ -997,7 +997,11 @@ int BPY_has_onload_script( void )
|
|||||||
|
|
||||||
void BPY_do_pyscript( ID * id, short event )
|
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 ) {
|
if( scriptlink && scriptlink->totscript ) {
|
||||||
PyObject *dict;
|
PyObject *dict;
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
*
|
*
|
||||||
* This is a new part of Blender.
|
* 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 *****
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
@@ -2194,6 +2195,8 @@ Material **EXPP_newMaterialList_fromPyList( PyObject * list )
|
|||||||
len = PySequence_Length( list );
|
len = PySequence_Length( list );
|
||||||
if( len > 16 )
|
if( len > 16 )
|
||||||
len = 16;
|
len = 16;
|
||||||
|
else if( len <= 0 )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
matlist = EXPP_newMaterialList( len );
|
matlist = EXPP_newMaterialList( len );
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
* This is a new part of Blender.
|
* This is a new part of Blender.
|
||||||
*
|
*
|
||||||
* Contributor(s): Willian P. Germano, Jordi Rovira i Bonet, Joseph Gilbert,
|
* Contributor(s): Willian P. Germano, Jordi Rovira i Bonet, Joseph Gilbert,
|
||||||
* Bala Gi
|
* Bala Gi, Alexander Szakaly
|
||||||
*
|
*
|
||||||
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
@@ -2045,6 +2045,7 @@ void EXPP_unlink_mesh( Mesh * me )
|
|||||||
me->mat[a]->id.us--;
|
me->mat[a]->id.us--;
|
||||||
me->mat[a] = 0;
|
me->mat[a] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ... here we want to preserve mesh keys */
|
/* ... here we want to preserve mesh keys */
|
||||||
/* if users want to get rid of them, they can use mesh.removeAllKeys() */
|
/* 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 )
|
if( me->texcomesh )
|
||||||
me->texcomesh = 0;
|
me->texcomesh = 0;
|
||||||
|
|
||||||
|
me->totcol = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int unlink_existingMeshData( Mesh * mesh )
|
static int unlink_existingMeshData( Mesh * mesh )
|
||||||
|
|||||||
Reference in New Issue
Block a user