Python API
---------- Bugfix #17911: Mesh.getFromObject() incorrectly decremented the mesh's material user refcount when the material was linked to the object.
This commit is contained in:
@@ -6271,19 +6271,12 @@ static PyObject *Mesh_getFromObject( BPy_Mesh * self, PyObject * args )
|
||||
if( origmesh->mat ) {
|
||||
for( i = origmesh->totcol; i-- > 0; ) {
|
||||
/* are we an object material or data based? */
|
||||
if (ob->colbits & 1<<i) {
|
||||
if (ob->colbits & 1<<i)
|
||||
self->mesh->mat[i] = ob->mat[i];
|
||||
|
||||
if (ob->mat[i])
|
||||
ob->mat[i]->id.us++;
|
||||
if (origmesh->mat[i])
|
||||
origmesh->mat[i]->id.us--;
|
||||
} else {
|
||||
else
|
||||
self->mesh->mat[i] = origmesh->mat[i];
|
||||
|
||||
if (origmesh->mat[i])
|
||||
origmesh->mat[i]->id.us++;
|
||||
}
|
||||
if (self->mesh->mat[i])
|
||||
self->mesh->mat[i]->id.us++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user