Got rid of some dead code
[blender-staging.git] / source / blender / editors / interface / interface_templates.c
index 74787e492c4d2d7bfe08b8ad13a206395d9005c7..b009581703f1535496c19ec4431224b8acc2fcf7 100644 (file)
@@ -1210,114 +1210,6 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
        return draw_constraint(layout, ob, con);
 }
 
-/************************* Group Template ***************************/
-
-#if 0
-static void do_add_groupmenu(void *arg, int event)
-{
-       Object *ob= OBACT;
-       
-       if(ob) {
-               
-               if(event== -1) {
-                       Group *group= add_group( "Group" );
-                       add_to_group(group, ob);
-               }
-               else
-                       add_to_group(BLI_findlink(&G.main->group, event), ob);
-                       
-               ob->flag |= OB_FROMGROUP;
-               BASACT->flag |= OB_FROMGROUP;
-               allqueue(REDRAWBUTSOBJECT, 0);
-               allqueue(REDRAWVIEW3D, 0);
-       }               
-}
-
-static uiBlock *add_groupmenu(void *arg_unused)
-{
-       uiBlock *block;
-       Group *group;
-       short xco=0, yco= 0, index=0;
-       char str[32];
-       
-       block= uiNewBlock(&curarea->uiblocks, "add_constraintmenu", UI_EMBOSSP, UI_HELV, curarea->win);
-       uiBlockSetButmFunc(block, do_add_groupmenu, NULL);
-
-       uiDefBut(block, BUTM, B_NOP, "ADD NEW",         0, 20, 160, 19, NULL, 0.0, 0.0, 1, -1, "");
-       for(group= G.main->group.first; group; group= group->id.next, index++) {
-               
-               /*if(group->id.lib) strcpy(str, "L  ");*/ /* we cant allow adding objects inside linked groups, it wont be saved anyway */
-               if(group->id.lib==0) {
-                       strcpy(str, "   ");
-                       strcat(str, group->id.name+2);
-                       uiDefBut(block, BUTM, B_NOP, str,       xco*160, -20*yco, 160, 19, NULL, 0.0, 0.0, 1, index, "");
-                       
-                       yco++;
-                       if(yco>24) {
-                               yco= 0;
-                               xco++;
-                       }
-               }
-       }
-       
-       uiTextBoundsBlock(block, 50);
-       uiBlockSetDirection(block, UI_DOWN);    
-       
-       return block;
-}
-
-static void group_ob_rem(void *gr_v, void *ob_v)
-{
-       Object *ob= OBACT;
-       
-       if(rem_from_group(gr_v, ob) && find_group(ob, NULL)==NULL) {
-               ob->flag &= ~OB_FROMGROUP;
-               BASACT->flag &= ~OB_FROMGROUP;
-       }
-       allqueue(REDRAWBUTSOBJECT, 0);
-       allqueue(REDRAWVIEW3D, 0);
-
-}
-
-static void group_local(void *gr_v, void *unused)
-{
-       Group *group= gr_v;
-       
-       group->id.lib= NULL;
-       
-       allqueue(REDRAWBUTSOBJECT, 0);
-       allqueue(REDRAWVIEW3D, 0);
-       
-}
-
-uiLayout *uiTemplateGroup(uiLayout *layout, Object *ob, Group *group)
-{
-       uiSetButLock(1, NULL);
-       uiDefBlockBut(block, add_groupmenu, NULL, "Add to Group", 10,150,150,20, "Add Object to a new Group");
-
-       /* all groups */
-       if(group->id.lib) {
-               uiLayoutRow()
-               uiBlockBeginAlign(block);
-               uiSetButLock(GET_INT_FROM_POINTER(group->id.lib), ERROR_LIBDATA_MESSAGE); /* We cant actually use this button */
-               uiDefBut(block, TEX, B_IDNAME, "GR:",   10, 120-yco, 100, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
-               uiClearButLock();
-               
-               but= uiDefIconBut(block, BUT, B_NOP, ICON_PARLIB, 110, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Make Group local");
-               uiButSetFunc(but, group_local, group, NULL);
-               uiBlockEndAlign(block);
-       } else {
-               but = uiDefBut(block, TEX, B_IDNAME, "GR:",     10, 120-yco, 120, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change.");
-               uiButSetFunc(but, test_idbutton_cb, group->id.name, NULL);
-       }
-       
-       xco = 290;
-       if(group->id.lib==0) { /* cant remove objects from linked groups */
-               but = uiDefIconBut(block, BUT, B_NOP, ICON_X, xco, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove Group membership");
-               uiButSetFunc(but, group_ob_rem, group, ob);
-       }
-}
-#endif
 
 /************************* Preview Template ***************************/