[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11548] trunk/blender/source/blender/src/ editarmature.c: Restoring a part of BeBraw' s patch that I removed before committing as it didn' t seem to be working at the time.

Joshua Leung aligorith at gmail.com
Sat Aug 11 14:09:09 CEST 2007


Revision: 11548
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11548
Author:   aligorith
Date:     2007-08-11 14:09:09 +0200 (Sat, 11 Aug 2007)

Log Message:
-----------
Restoring a part of BeBraw's patch that I removed before committing as it didn't seem to be working at the time.

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

Modified: trunk/blender/source/blender/src/editarmature.c
===================================================================
--- trunk/blender/source/blender/src/editarmature.c	2007-08-11 11:50:31 UTC (rev 11547)
+++ trunk/blender/source/blender/src/editarmature.c	2007-08-11 12:09:09 UTC (rev 11548)
@@ -1816,8 +1816,9 @@
 {
 	bArmature *arm= G.obedit->data;
 	EditBone *actbone, *ebone, *selbone;
-	short foundselbone= 0, val;
+	short allchildbones= 0, foundselbone= 0;
 	float offset[3];
+	short val;
 	
 	/* find active bone to parent to */
 	for (actbone = G.edbo.first; actbone; actbone=actbone->next) {
@@ -1836,6 +1837,7 @@
 		if (arm->layer & ebone->layer) {
 			if ((ebone->flag & BONE_SELECTED) && (ebone != actbone)) {
 				foundselbone++;
+				if (ebone->parent != actbone) allchildbones= 1; 
 			}	
 		}
 	}
@@ -1845,8 +1847,12 @@
 		return;
 	}
 	
+	/* 'Keep Offset' option is only displayed if it's likely to be useful */
+	if (allchildbones)
+		val= pupmenu("Make Parent%t|Connected%x1|Keep Offset%x2");
+	else
+		val= pupmenu("Make Parent%t|Connected%x1");
 	
-	val= pupmenu("Make Parent%t|Connected%x1|Keep Offset%x2");
 	if (val < 1) return;
 
 	if (foundselbone==0 && actbone->parent) {





More information about the Bf-blender-cvs mailing list