Added CTRL+L link copy and SHIFT+L link select for group-duplicators.

This commit is contained in:
Ton Roosendaal
2006-03-05 22:31:32 +00:00
parent 8ba4f45ec6
commit 8da71e806e
2 changed files with 21 additions and 2 deletions

View File

@@ -3003,7 +3003,9 @@ void make_links_menu()
strcat(str, "|Lattice Data%x2");
else if(ob->type==OB_ARMATURE)
strcat(str, "|Armature Data%x2");
else if(ob->type==OB_EMPTY)
strcat(str, "|Group%x6");
event= pupmenu(str);
if(event<= 0) return;
@@ -3110,6 +3112,14 @@ void make_links(short event)
do_ob_ipo(obt);
}
}
else if(event==6) {
if(ob->dup_group) ob->dup_group->id.us--;
obt->dup_group= ob->dup_group;
if(obt->dup_group) {
id_us_plus((ID *)obt->dup_group);
obt->transflag |= OB_DUPLIGROUP;
}
}
else if(event==3) { /* materials */
/* only if obt has no material: make arrays */
@@ -4544,7 +4554,7 @@ void selectlinks_menu(void)
/* If you modify this menu, please remember to update view3d_select_linksmenu
* in header_view3d.c and the menu in toolbox.c
*/
nr= pupmenu("Select Linked%t|Object Ipo%x1|ObData%x2|Material%x3|Texture%x4");
nr= pupmenu("Select Linked%t|Object Ipo%x1|ObData%x2|Material%x3|Texture%x4|Group%x5");
if (nr <= 0) return;
@@ -4588,6 +4598,9 @@ void selectlinks(int nr)
if(tex==0) return;
}
}
else if(nr==5) {
if(ob->dup_group==NULL) return;
}
else return;
base= FIRSTBASE;
@@ -4616,6 +4629,9 @@ void selectlinks(int nr)
}
}
}
else if(nr==5) {
if(base->object->dup_group==ob->dup_group) base->flag |= SELECT;
}
base->object->flag= base->flag;
}
base= base->next;

View File

@@ -1668,6 +1668,7 @@ static void do_view3d_edit_object_makelinksmenu(void *arg, int event)
case 2:
case 3:
case 4:
case 6:
make_links((short)event);
break;
}
@@ -1714,6 +1715,8 @@ static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
} else if(ob->type==OB_ARMATURE) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
} else if(ob->type==OB_EMPTY) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Group|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
}
}