[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17142] trunk/blender/source/blender/src: Bugfixes:

Joshua Leung aligorith at gmail.com
Tue Oct 21 10:00:19 CEST 2008


Revision: 17142
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17142
Author:   aligorith
Date:     2008-10-21 10:00:19 +0200 (Tue, 21 Oct 2008)

Log Message:
-----------
Bugfixes:

- Adding constraint using button in panel still didn't update Armature Editing buttons properly.
- Minor code tidying of earlier bugfix for armatures
- 'For Transform' option for Limit constraints is now only taken into account for constraints that are enabled.

Modified Paths:
--------------
    trunk/blender/source/blender/src/buttons_object.c
    trunk/blender/source/blender/src/editarmature.c
    trunk/blender/source/blender/src/transform.c

Modified: trunk/blender/source/blender/src/buttons_object.c
===================================================================
--- trunk/blender/source/blender/src/buttons_object.c	2008-10-21 06:10:36 UTC (rev 17141)
+++ trunk/blender/source/blender/src/buttons_object.c	2008-10-21 08:00:19 UTC (rev 17142)
@@ -2056,8 +2056,9 @@
 	if(ob->type==OB_ARMATURE) DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB);
 	else DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
 	
-	allqueue (REDRAWVIEW3D, 0);
-	allqueue (REDRAWBUTSOBJECT, 0);
+	allqueue(REDRAWVIEW3D, 0);
+	allqueue(REDRAWBUTSOBJECT, 0);
+	allqueue(REDRAWBUTSEDIT, 0);
 }
 
 void pointcache_bake(PTCacheID *pid, int startframe)

Modified: trunk/blender/source/blender/src/editarmature.c
===================================================================
--- trunk/blender/source/blender/src/editarmature.c	2008-10-21 06:10:36 UTC (rev 17141)
+++ trunk/blender/source/blender/src/editarmature.c	2008-10-21 08:00:19 UTC (rev 17142)
@@ -3277,8 +3277,11 @@
 		EditBone *ebo, *child=NULL, *parent=NULL;
 		
 		/* loop over bones in chain */
-		for (ebo= chain->data; ebo;) {
-			/* parent is this bone's original parent (to go to next if we swap) */
+		for (ebo= chain->data; ebo; ebo= parent) {
+			/* parent is this bone's original parent
+			 *	- we store this, as the next bone that is checked is this one
+			 *	  but the value of ebo->parent may change here...
+			 */
 			parent= ebo->parent;
 			
 			/* only if selected and editable */
@@ -3300,10 +3303,8 @@
 				
 				/* get next bones 
 				 *	- child will become the new parent of next bone
-				 *	- next bone to go to will be the original parent
 				 */
 				child= ebo;
-				ebo= parent;
 			}
 			else {
 				/* not swapping this bone, however, if its 'parent' got swapped, unparent us from it 
@@ -3315,11 +3316,10 @@
 				}
 				
 				/* get next bones
-				 *	- child will become new parent of next bone (not swapping occurred, so set to NULL to prevent infinite-loop)
-				 *	- next bone to go to will be the original parent (no change)
+				 *	- child will become new parent of next bone (not swapping occurred, 
+				 *	  so set to NULL to prevent infinite-loop)
 				 */
 				child= NULL;
-				ebo= parent;
 			}
 		}
 	}

Modified: trunk/blender/source/blender/src/transform.c
===================================================================
--- trunk/blender/source/blender/src/transform.c	2008-10-21 06:10:36 UTC (rev 17141)
+++ trunk/blender/source/blender/src/transform.c	2008-10-21 08:00:19 UTC (rev 17142)
@@ -1502,6 +1502,10 @@
 		for (con= td->con; con; con= con->next) {
 			float tmat[4][4];
 			
+			/* only consider constraint if enabled */
+			if (con->flag & CONSTRAINT_DISABLE) continue;
+			if (con->enforce == 0.0f) continue;
+			
 			/* only use it if it's tagged for this purpose (and the right type) */
 			if (con->type == CONSTRAINT_TYPE_LOCLIMIT) {
 				bLocLimitConstraint *data= con->data;
@@ -1585,7 +1589,11 @@
 			
 		/* Evaluate valid constraints */
 		for (con= td->con; con; con= con->next) {
-			/* we're only interested in Limit-Scale constraints */
+			/* only consider constraint if enabled */
+			if (con->flag & CONSTRAINT_DISABLE) continue;
+			if (con->enforce == 0.0f) continue;
+			
+			/* we're only interested in Limit-Rotation constraints */
 			if (con->type == CONSTRAINT_TYPE_ROTLIMIT) {
 				bRotLimitConstraint *data= con->data;
 				float tmat[4][4];
@@ -1675,6 +1683,10 @@
 			
 		/* Evaluate valid constraints */
 		for (con= td->con; con; con= con->next) {
+			/* only consider constraint if enabled */
+			if (con->flag & CONSTRAINT_DISABLE) continue;
+			if (con->enforce == 0.0f) continue;
+			
 			/* we're only interested in Limit-Scale constraints */
 			if (con->type == CONSTRAINT_TYPE_SIZELIMIT) {
 				bSizeLimitConstraint *data= con->data;





More information about the Bf-blender-cvs mailing list