* Menus for Bone-Groups
authorJoshua Leung <aligorith@gmail.com>
Tue, 22 Jan 2008 03:35:14 +0000 (03:35 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 22 Jan 2008 03:35:14 +0000 (03:35 +0000)
* Added missing #include in poseobject.c

source/blender/include/BIF_poseobject.h
source/blender/src/header_view3d.c
source/blender/src/poseobject.c
source/blender/src/space.c

index 7a73384c319a6a5f900b043c6f895bea0a0e9da4..f356c9d664cb9a06d385ca6b98807f19ca5f1024 100644 (file)
@@ -65,7 +65,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_remove_from_posegroup(void);
+void pose_remove_from_posegroups(void);
 void pgroup_operation_with_menu(void);
 
 void pose_calculate_path(struct Object *ob);
index 3d2f81cba024fb90eda14374242ed9e7107ef6d5..f7cf9dd22cd840c6ee914ee832bced41c2851f93 100644 (file)
@@ -4044,6 +4044,42 @@ static uiBlock *view3d_pose_armature_constraintsmenu(void *arg_unused)
        return block;
 }
 
+static void do_view3d_pose_armature_groupmenu(void *arg, int event)
+{
+       switch (event) {
+               case 1:
+                       pose_assign_to_posegroup();
+                       break;
+               case 2:
+                       pose_add_posegroup();
+                       break;
+               case 3:
+                       pose_remove_from_posegroups();
+                       break;
+               case 4:
+                       pose_remove_posegroup();
+                       break;
+       }
+}
+
+static uiBlock *view3d_pose_armature_groupmenu(void *arg_unused)
+{
+       uiBlock *block;
+       short yco = 20, menuwidth = 120;
+       
+       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, "");
+       
+       uiBlockSetDirection(block, UI_RIGHT);
+       uiTextBoundsBlock(block, 60);
+       return block;
+}
+
 static void do_view3d_pose_armature_motionpathsmenu(void *arg, int event)
 {
        
@@ -4198,6 +4234,8 @@ static uiBlock *view3d_pose_armaturemenu(void *arg_unused)
        
        uiDefIconTextBlockBut(block, view3d_pose_armature_poselibmenu, NULL, ICON_RIGHTARROW_THIN, "Pose Library", 0, yco-=20, 120, 19, "");
        uiDefIconTextBlockBut(block, view3d_pose_armature_motionpathsmenu, NULL, ICON_RIGHTARROW_THIN, "Motion Paths", 0, yco-=20, 120, 19, "");
+       uiDefIconTextBlockBut(block, view3d_pose_armature_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Groups", 0, yco-=20, 120, 19, "");
+       uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
        uiDefIconTextBlockBut(block, view3d_pose_armature_ikmenu, NULL, ICON_RIGHTARROW_THIN, "Inverse Kinematics", 0, yco-=20, 120, 19, "");
        uiDefIconTextBlockBut(block, view3d_pose_armature_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, "");
        
index 0b55e4c9a68ede9dcc75970532ed3f290709773a..42640465e1201e5234673cdc5af76b7d0bd008d1 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <stdlib.h>
+#include <stddef.h>
 #include <string.h>
 
 #include "MEM_guardedalloc.h"
index 3d4a85bbcd856f082beac68d92fc6f7f76b0b824..582fa662e7e491385eae76b5ca51f1f5b4925e4a 100644 (file)
@@ -1955,7 +1955,10 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        if(G.obedit) {
                                                if(G.obedit->type==OB_MESH)
                                                        select_mesh_group_menu();
-                                       } else
+                                       } 
+                                       else if(ob && (ob->flag & OB_POSEMODE))
+                                               puts("Shift-G menu for PoseMode - Not Implemented!");
+                                       else
                                                select_object_grouped_menu();
                                else if((G.obedit==0) && G.qual==LR_ALTKEY) {
                                        if(okee("Clear location")) {