[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11006] trunk/blender/source/blender/ python/api2_2x/Object.c: (Python Object API)

Campbell Barton cbarton at metavr.com
Fri Jun 22 15:38:15 CEST 2007


Revision: 11006
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11006
Author:   campbellbarton
Date:     2007-06-22 15:38:15 +0200 (Fri, 22 Jun 2007)

Log Message:
-----------
(Python Object API)
setting object layers didnt break once the base of an object was found.
DAG update and countall ran even when the object wasnt in the scene.

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

Modified: trunk/blender/source/blender/python/api2_2x/Object.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Object.c	2007-06-22 13:08:03 UTC (rev 11005)
+++ trunk/blender/source/blender/python/api2_2x/Object.c	2007-06-22 13:38:15 UTC (rev 11006)
@@ -1230,7 +1230,9 @@
 		}
 		base = base->next;
 	}
-	countall(  );
+	if (base) { /* was the object selected? */
+		countall(  );
+	}
 	return 0;
 }
 
@@ -4297,13 +4299,16 @@
 			local = base->lay;
 			base->lay = local | layers;
 			self->object->lay = base->lay;
+			break;
 		}
 		base = base->next;
 	}
 	
 	/* these to calls here are overkill! (ton) */
-	countall();
-	DAG_scene_sort( G.scene );
+	if (base) { /* The object was found? */
+		countall();
+		DAG_scene_sort( G.scene );
+	}
 	return 0;
 }
 
@@ -4333,11 +4338,14 @@
 			local = base->lay;
 			base->lay = local | layers;
 			self->object->lay = base->lay;
+			break;
 		}
 		base = base->next;
 	}
-	countall();
-	DAG_scene_sort( G.scene );
+	if (base) { /* The object was found? */
+		countall();
+		DAG_scene_sort( G.scene );
+	}
 	return 0;
 }
 





More information about the Bf-blender-cvs mailing list