[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17204] trunk/blender/source/blender/ python/api2_2x/Mesh.c: Python API

Ken Hughes khughes at pacific.edu
Tue Oct 28 01:01:20 CET 2008


Revision: 17204
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17204
Author:   khughes
Date:     2008-10-28 01:01:20 +0100 (Tue, 28 Oct 2008)

Log Message:
-----------
Python API
----------
Bugfix #17911: Mesh.getFromObject() incorrectly decremented the mesh's
material user refcount when the material was linked to the object.

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Mesh.c

Modified: trunk/blender/source/blender/python/api2_2x/Mesh.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Mesh.c	2008-10-27 23:25:08 UTC (rev 17203)
+++ trunk/blender/source/blender/python/api2_2x/Mesh.c	2008-10-28 00:01:20 UTC (rev 17204)
@@ -6271,19 +6271,12 @@
 			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++;
 				}
 			}
 		}





More information about the Bf-blender-cvs mailing list