[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13473] trunk/blender/source/blender: * Bone Groups - changed some of the options in the Ctrl-G menu so that it is more useful

Joshua Leung aligorith at gmail.com
Wed Jan 30 12:09:18 CET 2008


Revision: 13473
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13473
Author:   aligorith
Date:     2008-01-30 12:09:18 +0100 (Wed, 30 Jan 2008)

Log Message:
-----------
* Bone Groups - changed some of the options in the Ctrl-G menu so that it is more useful
* Tweaked one of the colours in the colour sets so that it is less similar to a colour in another set representing another state.

Modified Paths:
--------------
    trunk/blender/source/blender/include/BIF_poseobject.h
    trunk/blender/source/blender/src/header_view3d.c
    trunk/blender/source/blender/src/poseobject.c
    trunk/blender/source/blender/src/resources.c
    trunk/blender/source/blender/src/usiblender.c

Modified: trunk/blender/source/blender/include/BIF_poseobject.h
===================================================================
--- trunk/blender/source/blender/include/BIF_poseobject.h	2008-01-30 10:43:44 UTC (rev 13472)
+++ trunk/blender/source/blender/include/BIF_poseobject.h	2008-01-30 11:09:18 UTC (rev 13473)
@@ -64,7 +64,7 @@
 void pose_add_posegroup(void);
 void pose_remove_posegroup(void);
 char *build_posegroups_menustr(struct bPose *pose, short for_pupmenu);
-void pose_assign_to_posegroup(void);
+void pose_assign_to_posegroup(short active);
 void pose_remove_from_posegroups(void);
 void pgroup_operation_with_menu(void);
 

Modified: trunk/blender/source/blender/src/header_view3d.c
===================================================================
--- trunk/blender/source/blender/src/header_view3d.c	2008-01-30 10:43:44 UTC (rev 13472)
+++ trunk/blender/source/blender/src/header_view3d.c	2008-01-30 11:09:18 UTC (rev 13473)
@@ -4096,15 +4096,18 @@
 {
 	switch (event) {
 		case 1:
-			pose_assign_to_posegroup();
+			pose_assign_to_posegroup(1);
 			break;
 		case 2:
+			pose_assign_to_posegroup(0);
+			break;
+		case 3:
 			pose_add_posegroup();
 			break;
-		case 3:
+		case 4:
 			pose_remove_from_posegroups();
 			break;
-		case 4:
+		case 5:
 			pose_remove_posegroup();
 			break;
 	}
@@ -4118,10 +4121,11 @@
 	block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
 	uiBlockSetButmFunc(block, do_view3d_pose_armature_groupmenu, NULL);
 	
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Selected to Group|Ctrl G, 1",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add New Group|Ctrl G, 2",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G, 3",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Active Group|Ctrl G, 4",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Selected to Active Group|Ctrl G",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Selected to Group|Ctrl G",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add New Group|Ctrl G",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Active Group|Ctrl G",	0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
 	
 	uiBlockSetDirection(block, UI_RIGHT);
 	uiTextBoundsBlock(block, 60);

Modified: trunk/blender/source/blender/src/poseobject.c
===================================================================
--- trunk/blender/source/blender/src/poseobject.c	2008-01-30 10:43:44 UTC (rev 13472)
+++ trunk/blender/source/blender/src/poseobject.c	2008-01-30 11:09:18 UTC (rev 13473)
@@ -1007,7 +1007,7 @@
 }
 
 /* Assign selected pchans to the bone group that the user selects */
-void pose_assign_to_posegroup ()
+void pose_assign_to_posegroup (short active)
 {
 	Object *ob= OBACT;
 	bArmature *arm= (ob) ? ob->data : NULL;
@@ -1022,18 +1022,20 @@
 		return;
 
 	/* get group to affect */
-	menustr= build_posegroups_menustr(pose, 1);
-	nr= pupmenu(menustr);
-	MEM_freeN(menustr);
-	
-	if (nr < 0) 
-		return;
-	else if (nr == 0) {
-		/* add new - note: this does an undo push and sets active group */
-		pose_add_posegroup();
+	if ((active==0) || (pose->active_group <= 0)) {
+		menustr= build_posegroups_menustr(pose, 1);
+		nr= pupmenu(menustr);
+		MEM_freeN(menustr);
+		
+		if (nr < 0) 
+			return;
+		else if (nr == 0) {
+			/* add new - note: this does an undo push and sets active group */
+			pose_add_posegroup();
+		}
+		else
+			pose->active_group= nr;
 	}
-	else
-		pose->active_group= nr;
 	
 	/* add selected bones to group then */
 	for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -1103,16 +1105,19 @@
 	
 	/* get mode of action */
 	if (pchan)
-		mode= pupmenu("Bone Groups%t|Add Selected to Group%x1|Add New Group%x2|Remove Selected From Groups%x3|Remove Active Group%x4");
+		mode= pupmenu("Bone Groups%t|Add Selected to Active Group%x1|Add Selected to Group%x2|%|Remove Selected From Groups%x3|Remove Active Group%x4");
 	else
-		mode= pupmenu("Bone Groups%t|Add New Group%x2|Remove Active Group%x4");
+		mode= pupmenu("Bone Groups%t|Add New Group%x5|Remove Active Group%x4");
 		
 	/* handle mode */
 	switch (mode) {
 		case 1:
-			pose_assign_to_posegroup();
+			pose_assign_to_posegroup(1);
 			break;
 		case 2:
+			pose_assign_to_posegroup(0);
+			break;
+		case 5:
 			pose_add_posegroup();
 			break;
 		case 3:

Modified: trunk/blender/source/blender/src/resources.c
===================================================================
--- trunk/blender/source/blender/src/resources.c	2008-01-30 10:43:44 UTC (rev 13472)
+++ trunk/blender/source/blender/src/resources.c	2008-01-30 11:09:18 UTC (rev 13473)
@@ -375,7 +375,7 @@
 		/* set 1 */
 	SETCOL(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
 	SETCOL(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
-	SETCOL(btheme->tarm[0].active, 0xea, 0x01, 0x01, 255);
+	SETCOL(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
 		/* set 2 */
 	SETCOL(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
 	SETCOL(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);

Modified: trunk/blender/source/blender/src/usiblender.c
===================================================================
--- trunk/blender/source/blender/src/usiblender.c	2008-01-30 10:43:44 UTC (rev 13472)
+++ trunk/blender/source/blender/src/usiblender.c	2008-01-30 11:09:18 UTC (rev 13473)
@@ -409,7 +409,7 @@
 					/* set 1 */
 				SETCOL(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
 				SETCOL(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
-				SETCOL(btheme->tarm[0].active, 0xea, 0x01, 0x01, 255);
+				SETCOL(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
 					/* set 2 */
 				SETCOL(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
 				SETCOL(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);





More information about the Bf-blender-cvs mailing list