diff options
author | Ken Hughes <khughes@pacific.edu> | 2008-10-28 03:01:20 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2008-10-28 03:01:20 +0300 |
commit | 5cd569ed0ede0c6aba214f785ff1aa3551afee4f (patch) | |
tree | 4e591fff3cb0260170ccf6d74d30ec96fdeb67a5 | |
parent | 2e96728843d01fa0e8c79133b0e7f943930405de (diff) |
Python API
----------
Bugfix #17911: Mesh.getFromObject() incorrectly decremented the mesh's
material user refcount when the material was linked to the object.
-rw-r--r-- | source/blender/python/api2_2x/Mesh.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index a97a55244ad..32ddb464c88 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -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++; } } } |