[Bf-python] Materials bug in convert_NMeshToMesh

Joseph Gilbert models at paposo.com
Sun Jan 11 02:54:04 CET 2004


I was chit chatting on blender.org's python forum and someone ran into a
problem with materials being updated correctly.  Problem is that when the
Py_Nmesh is converted to the Mesh for linking to an object the materials are
not updated.  You can get away with it until you open the OOPS window and
then it crashes on the NULL pointer in the mesh. To update the materials
when you link to an object:

static int convert_NMeshToMesh (Mesh *mesh, BPy_NMesh *nmesh)
{
.......

	if(nmesh->materials){
	mesh->mat = EXPP_newMaterialList_fromPyList (nmesh->materials);
	}
........
}
Is this o.k. to patch?:




More information about the Bf-python mailing list