* Big menus update

Hard to describe other than by saying:

* Updates, re-thought organisation, etc based on testing
and feedback from 2.30 -> 2.31
* A *lot* of missing entries added
* Toolbox expanded, tidied and more consistent with
 pulldown menus
* A lot of functionality hidden behind secondary pupmenu()s is now exposed through arguments, so that
they can be more easily explored from the pulldowns and
toolbox.

This is the reason for the many changed files in this
commit - had to clean up editing functions. Mixing
interface code in the middle of editing functionality is not
good for menus and toolboxes. Please don't do it!

At this stage, the menu and toolbox system (at least for most window spaces) should be just about 'stable' and 'complete'. It's now up to people to keep them up to date :)
This commit is contained in:
Matt Ebb 2004-01-12 13:30:00 +00:00
parent e40eaa4d47
commit 9de93ac9dc
14 changed files with 1147 additions and 287 deletions

@ -64,9 +64,11 @@ void movetolayer(void);
void special_editmenu(void);
void convertmenu(void);
void copymenu_properties(struct Object *ob);
void copymenu(void);
void copy_attr_menu(void);
void copy_attr(short event);
void link_to_scene(unsigned short nr);
void linkmenu(void);
void make_links_menu(void);
void make_links(short event);
void make_duplilist_real(void);
void apply_object(void);
void ob_to_transob(struct Object *ob, struct TransOb *tob);
@ -102,7 +104,8 @@ void single_mat_users_expand(void);
void single_user(void);
void make_local(void);
void adduplicate(float *dtrans);
void selectlinks(void);
void selectlinks_menu(void);
void selectlinks(int nr);
void image_aspect(void);
void set_ob_ipoflags(void);
void select_select_keys(void);
@ -115,6 +118,7 @@ void first_base(void);
void make_displists_by_obdata(void *obdata);
void flip_subdivison(struct Object *ob, int);
void mirrormenu(void);
void mirror(short mode);
#endif /* BDR_EDITOBJECT_H */

@ -34,7 +34,7 @@ struct Group;
void set_active_group(void);
void add_selected_to_group(void);
void rem_selected_from_group(void);
void group_menu(void);
void prev_group_key(struct Group *group);
void next_group_key(struct Group *group);
void select_group_menu(void);
void select_group(short nr);

@ -102,7 +102,8 @@ extern void winqreadnlaspace(struct ScrArea *sa, void *spacedata, struct B
extern void winqreadseqspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
extern void test_butspace(void);
extern void start_game(void);
extern void group_menu(void);
extern void select_group_menu(void);
extern void select_group(short nr);
#ifdef _WIN32 // FULLSCREEN

@ -46,5 +46,11 @@ void duplicate_context_selected(void);
void toggle_shading(void);
void minmax_verts(float *min, float *max);
void snap_sel_to_grid(void);
void snap_sel_to_curs(void);
void snap_curs_to_grid(void);
void snap_curs_to_sel(void);
void snap_to_center(void);
#endif /* BSE_EDIT_H */

@ -96,8 +96,10 @@ void insert_vert_ipo(struct IpoCurve *icu, float x, float y);
void add_vert_ipo(void);
void add_duplicate_editipo(void);
void remove_doubles_ipo(void);
void join_ipo(void);
void ipo_snapmenu(void);
void join_ipo_menu(void);
void join_ipo(int mode);
void ipo_snap_menu(void);
void ipo_snap(short event);
void mouse_select_ipo(void);
void sethandles_ipo(int code);
void select_ipo_bezier_keys(struct Ipo *ipo, int selectmode);

@ -115,13 +115,18 @@ void do_info_add_metamenu(void *arg, int event);
void do_info_addmenu(void *arg, int event);
/* header_view3d.c */
void do_view3d_select_object_groupedmenu(void *arg, int event);
void do_view3d_select_object_linkedmenu(void *arg, int event);
void do_view3d_select_object_layermenu(void *arg, int event);
void do_view3d_select_object_typemenu(void *arg, int event);
void do_view3d_select_meshmenu(void *arg, int event);
void do_view3d_select_curvemenu(void *arg, int event);
void do_view3d_edit_snapmenu(void *arg, int event);
void do_view3d_edit_mesh_mirrormenu(void *arg, int event);
void do_view3d_edit_mesh_normalsmenu(void *arg, int event);
void do_view3d_edit_mesh_verticesmenu(void *arg, int event);
void do_view3d_edit_mesh_edgesmenu(void *arg, int event);
void do_view3d_edit_curve_segmentsmenu(void *arg, int event);
void do_view3d_edit_curve_showhidemenu(void *arg, int event);
#endif /* BSE_HEADERBUTTONS_H */

@ -1165,7 +1165,7 @@ void snapmenu()
{
short event;
event = pupmenu("SNAP %t|Sel -> Grid%x1|Sel -> Curs%x2|Curs-> Grid%x3|Curs-> Sel%x4|Sel-> Center%x5");
event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Cursor-> Grid%x3|Cursor-> Selection%x4|Selection-> Center%x5");
switch (event) {
case 1: /*Selection to grid*/

@ -2278,23 +2278,36 @@ void remove_doubles_ipo()
deselectall_editipo();
}
void join_ipo()
void join_ipo_menu(void)
{
int mode = 0;
mode= pupmenu("Join %t|All Selected %x1|Selected Doubles %x2");
if (mode == -1) return;
join_ipo(mode);
}
void join_ipo(int mode)
{
EditIpo *ei;
IpoKey *ik;
IpoCurve *icu;
BezTriple *bezt, *beztn, *newb;
float val;
int mode, tot, a, b;
int tot, a, b;
get_status_editipo();
mode= pupmenu("Join %t|All Selected %x1|Selected doubles %x2");
/* Mode events:
* All Selected: 1
* Selected Doubles: 2
*/
if( mode==2 ) {
remove_doubles_ipo();
return;
}
else if(mode!=1) return;
/* first: multiple selected verts in 1 curve */
ei= G.sipo->editipo;
@ -2395,16 +2408,30 @@ void join_ipo()
deselectall_editipo();
}
void ipo_snapmenu()
void ipo_snap_menu(void)
{
short event;
event= pupmenu("Snap %t|Horizontal %x1|To Next %x2|To Frame %x3|To Current Frame%x4");
if(event < 1) return;
ipo_snap(event);
}
void ipo_snap(short event)
{
EditIpo *ei;
BezTriple *bezt;
float dx = 0.0;
int a, b;
short event, ok, ok2;
short ok, ok2;
event= pupmenu("Snap %t|Horizontal %x1|To next %x2|To frame %x3|To current frame%x4");
if(event < 1) return;
/* events:
* Horizontal : 1
* To Next: 2
* To Frame: 3
* To Current Frame: 4
*/
get_status_editipo();

@ -1932,32 +1932,23 @@ void copymenu_logicbricks(Object *ob)
}
}
void copymenu()
void copy_attr_menu()
{
Object *ob, *obt;
Base *base;
Curve *cu, *cu1;
void *poin1, *poin2=0;
Object *ob;
short event;
char str[256];
if(G.scene->id.lib) return;
if(OBACT==0) return;
if(G.obedit) {
/* obedit_copymenu(); */
return;
}
strcpy(str, "COPY %t|Loc%x1|Rot%x2|Size%x3|Drawtype%x4|TimeOffs%x5|Dupli%x6|%l|Mass%x7|Damping%x8|Properties%x9|Logic Bricks%x10");
/* If you change this menu, don't forget to update the menu in header_view3d.c
* view3d_edit_object_copyattrmenu() and in toolbox.c
*/
strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Drawtype%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|Properties%x9|Logic Bricks%x10|%l");
ob= OBACT;
strcat (str, "|Object Constraints%x22");
if ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL) {
strcat(str, "|Tex Space%x17");
if(ob->type==OB_MESH) poin2= &(((Mesh *)ob->data)->texflag);
else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) poin2= &(((Curve *)ob->data)->texflag);
else if(ob->type==OB_MBALL) poin2= &(((MetaBall *)ob->data)->texflag);
strcat(str, "|Texture Space%x17");
}
if(ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19");
@ -1969,11 +1960,35 @@ void copymenu()
if( give_parteff(ob) ) strcat(str, "|Particle Settings%x20");
strcat (str, "|Object Constraints%x22");
event= pupmenu(str);
if(event<= 0) return;
copy_attr(event);
}
void copy_attr(short event)
{
Object *ob, *obt;
Base *base;
Curve *cu, *cu1;
void *poin1, *poin2=0;
if(G.scene->id.lib) return;
ob= OBACT;
if(OBACT==0) return;
if(G.obedit) {
/* obedit_copymenu(); */
return;
}
if ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL) {
if(ob->type==OB_MESH) poin2= &(((Mesh *)ob->data)->texflag);
else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) poin2= &(((Curve *)ob->data)->texflag);
else if(ob->type==OB_MBALL) poin2= &(((MetaBall *)ob->data)->texflag);
}
if(event==9) {
copymenu_properties(ob);
return;
@ -2163,7 +2178,44 @@ void link_to_scene(unsigned short nr)
}
}
void linkmenu()
void make_links_menu()
{
Object *ob;
short event=0;
char str[140];
if(OBACT==0) return;
ob= OBACT;
strcpy(str, "Make Links %t|To Scene...%x1|%l|Object Ipo%x4");
if(ob->type==OB_MESH)
strcat(str, "|Mesh Data%x2|Materials%x3");
else if(ob->type==OB_CURVE)
strcat(str, "|Curve Data%x2|Materials%x3");
else if(ob->type==OB_FONT)
strcat(str, "|Text Data%x2|Materials%x3");
else if(ob->type==OB_SURF)
strcat(str, "|Surface Data%x2|Materials%x3");
else if(ob->type==OB_MBALL)
strcat(str, "|Materials%x3");
else if(ob->type==OB_CAMERA)
strcat(str, "|Camera Data%x2");
else if(ob->type==OB_LAMP)
strcat(str, "|Lamp Data%x2");
else if(ob->type==OB_LATTICE)
strcat(str, "|Lattice Data%x2");
else if(ob->type==OB_ARMATURE)
strcat(str, "|Armature Data%x2");
event= pupmenu(str);
if(event<= 0) return;
make_links(event);
}
void make_links(short event)
{
Object *ob, *obt;
Base *base, *nbase, *sbase;
@ -2171,36 +2223,12 @@ void linkmenu()
ID *id;
Material ***matarar, ***obmatarar, **matar1, **matar2;
int a;
short event, *totcolp, nr;
char str[140], *strp;
short *totcolp, nr;
char *strp;
if(OBACT==0) return;
ob= OBACT;
strcpy(str, "MAKE LINKS %t|To scene...%x1|Object Ipo%x4");
if(ob->type==OB_MESH)
strcat(str, "|Mesh data%x2|Materials%x3");
else if(ob->type==OB_CURVE)
strcat(str, "|Curve data%x2|Materials%x3");
else if(ob->type==OB_FONT)
strcat(str, "|Font data%x2|Materials%x3");
else if(ob->type==OB_SURF)
strcat(str, "|Surf data%x2|Materials%x3");
else if(ob->type==OB_MBALL)
strcat(str, "|Materials%x3");
else if(ob->type==OB_CAMERA)
strcat(str, "|Camera data%x2");
else if(ob->type==OB_LAMP)
strcat(str, "|Lamp data%x2");
else if(ob->type==OB_LATTICE)
strcat(str, "|Lattice data%x2");
else if(ob->type==OB_ARMATURE)
strcat(str, "|Armature data%x2");
event= pupmenu(str);
if(event<= 0) return;
if(event==1) {
IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), 0, &nr);
@ -6780,8 +6808,25 @@ void adduplicate(float *dtrans)
allqueue(REDRAWIPO, 0); /* also oops */
}
void selectlinks_menu(void)
{
Object *ob;
int nr;
void selectlinks(void)
ob= OBACT;
if(ob==0) return;
/* 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");
if (nr <= 0) return;
selectlinks(nr);
}
void selectlinks(int nr)
{
Object *ob;
Base *base;
@ -6789,11 +6834,18 @@ void selectlinks(void)
Ipo *ipo = NULL;
Material *mat = NULL, *mat1;
Tex *tex=0;
int a, b, nr;
int a, b;
/* events (nr):
* Object Ipo: 1
* ObData: 2
* Current Material: 3
* Current Texture: 4
*/
ob= OBACT;
if(ob==0) return;
nr= pupmenu("Select links%t|Object Ipo|Object Data|Current Material|Current texture");
if(nr==1) {
ipo= ob->ipo;
@ -7305,7 +7357,7 @@ void mirrormenu(void){
if (G.obedit==0) return;
mode=pupmenu("Mirror Axis %t|Global X%x1| Y%x2| Z%x3|Local X%x4| Y%x5| Z%x6|View X%x7| Y%x8| Z%x9|");
mode=pupmenu("Mirror Axis %t|X Global%x1|Y Global%x2|Z Global%x3|%l|X Local%x4|Y local%x5|Z Local%x6|%l|X View%x7|Y View%x8|Z View%x9|");
if (mode==-1) return; /* return */

@ -185,6 +185,8 @@ void do_action_buttons(unsigned short event)
static void do_action_viewmenu(void *arg, int event)
{
extern int play_anim(int mode);
switch(event) {
case ACTMENU_VIEW_CENTERVIEW: /* Center View to Current Frame */
center_currframe();

@ -86,6 +86,65 @@
static int viewmovetemp = 0;
extern int totipo_edit, totipo_sel;
static void do_ipo_editmenu_snapmenu(void *arg, int event)
{
switch(event) {
case 1: /* Horizontal */
case 2: /* To Next */
case 3: /* To Frame */
case 4: /* To Current Frame */
ipo_snap(event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *ipo_editmenu_snapmenu(void *arg_unused)
{
uiBlock *block;
short yco = 20, menuwidth = 120;
block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_ipo_editmenu_snapmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Horizontal|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Next|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Frame|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Current Frame|Shift S, 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_ipo_editmenu_joinmenu(void *arg, int event)
{
switch(event) {
case 1: /* All Selected */
case 2: /* Selected Doubles */
join_ipo(event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *ipo_editmenu_joinmenu(void *arg_unused)
{
uiBlock *block;
short yco = 20, menuwidth = 120;
block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_joinmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_ipo_editmenu_joinmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Selected|J, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Doubles|J, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
static void do_ipo_editmenu_keymenu(void *arg, int event)
{
Key *key;
@ -286,6 +345,9 @@ static void do_ipo_editmenu(void *arg, int event)
case 4 :
add_blockhandler(curarea, IPO_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
break;
case 5:
//join_ipo();
break;
}
}
@ -303,6 +365,7 @@ static uiBlock *ipo_editmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_ipo_editmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
uiDefIconTextBlockBut(block, ipo_editmenu_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -311,8 +374,9 @@ static uiBlock *ipo_editmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Record Mouse Movement|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBlockBut(block, ipo_editmenu_joinmenu, NULL, ICON_RIGHTARROW_THIN, "Join", 0, yco-=20, 120, 19, "");
if (!G.sipo->showkey){
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");

@ -67,6 +67,7 @@
#include "BKE_library.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
@ -187,13 +188,33 @@ static void do_view3d_view_cameracontrolsmenu(void *arg, int event)
case 3: /* Orbit Down */
persptoetsen(PAD2);
break;
case 4: /* Zoom In */
case 4: /* Pan left */
/* ugly hack alert */
G.qual |= LR_CTRLKEY;
persptoetsen(PAD4);
G.qual &= ~LR_CTRLKEY;
case 5: /* Pan right */
/* ugly hack alert */
G.qual |= LR_CTRLKEY;
persptoetsen(PAD6);
G.qual &= ~LR_CTRLKEY;
case 6: /* Pan up */
/* ugly hack alert */
G.qual |= LR_CTRLKEY;
persptoetsen(PAD8);
G.qual &= ~LR_CTRLKEY;
case 7: /* Pan down */
/* ugly hack alert */
G.qual |= LR_CTRLKEY;
persptoetsen(PAD2);
G.qual &= ~LR_CTRLKEY;
case 9: /* Zoom In */
persptoetsen(PADPLUSKEY);
break;
case 5: /* Zoom Out */
case 10: /* Zoom Out */
persptoetsen(PADMINUS);
break;
case 6: /* Reset Zoom */
case 11: /* Reset Zoom */
persptoetsen(PADENTER);
break;
}
@ -216,22 +237,96 @@ static uiBlock *view3d_view_cameracontrolsmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 50);
return block;
}
static void do_view3d_view_alignviewmenu(void *arg, int event)
{
View3D *v3d= curarea->spacedata.first;
float *curs;
switch(event) {
case 0: /* Align View to Selected (edit/faceselect mode) */
case 1:
case 2:
if ((G.obedit) && (G.obedit->type == OB_MESH)) {
editmesh_align_view_to_selected(v3d, event);
} else if (G.f & G_FACESELECT) {
Object *obact= OBACT;
if (obact && obact->type==OB_MESH) {
Mesh *me= obact->data;
if (me->tface) {
faceselect_align_view_to_selected(v3d, me, event);
addqueue(v3d->area->win, REDRAW, 1);
}
}
}
break;
case 3: /* Center View to Cursor */
curs= give_cursor();
G.vd->ofs[0]= -curs[0];
G.vd->ofs[1]= -curs[1];
G.vd->ofs[2]= -curs[2];
scrarea_queue_winredraw(curarea);
break;
case 4: /* Align Active Camera to View */
/* This ugly hack is a symptom of the nasty persptoetsen function,
* but at least it works for now.
*/
G.qual |= LR_SHIFTKEY;
persptoetsen(PAD0);
G.qual &= ~LR_SHIFTKEY;
break;
case 5: /* Align View to Selected (object mode) */
mainqenter(PADASTERKEY, 1);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_view_alignviewmenu(void *arg_unused)
{
/* static short tog=0; */
uiBlock *block;
short yco= 0, menuwidth=120;
block= uiNewBlock(&curarea->uiblocks, "view3d_view_alignviewmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Centre View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Shift NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
if (((G.obedit) && (G.obedit->type == OB_MESH)) || (G.f & G_FACESELECT)) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
} else {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
}
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 50);
return block;
}
static void do_view3d_viewmenu(void *arg, int event)
{
extern int play_anim(int mode);
void setcameratoview3d(void); // view.c
float *curs;
switch(event) {
case 0: /* User */
@ -264,33 +359,15 @@ static void do_view3d_viewmenu(void *arg, int event)
G.vd->localview= 0;
endlocalview(curarea);
break;
case 9: /* Frame All (Home) */
case 9: /* View All (Home) */
view3d_home(0);
break;
case 10: /* Center at Cursor */
curs= give_cursor();
G.vd->ofs[0]= -curs[0];
G.vd->ofs[1]= -curs[1];
G.vd->ofs[2]= -curs[2];
scrarea_queue_winredraw(curarea);
break;
case 11: /* Center View to Selected */
case 11: /* View Selected */
centreview();
break;
case 12: /* Align View to Selected */
mainqenter(PADASTERKEY, 1);
break;
case 13: /* Play Back Animation */
play_anim(0);
break;
case 14: /* Align Active Camera to View */
/* This ugly hack is a symptom of the nasty persptoetsen function,
* but at least it works for now.
*/
G.qual |= LR_SHIFTKEY;
persptoetsen(PAD0);
G.qual &= ~LR_SHIFTKEY;
break;
case 15: /* Background Image... */
add_blockhandler(curarea, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW);
break;
@ -312,8 +389,6 @@ static uiBlock *view3d_viewmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -345,17 +420,14 @@ static uiBlock *view3d_viewmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Frame Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Shift NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Centre View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -374,40 +446,40 @@ static uiBlock *view3d_viewmenu(void *arg_unused)
return block;
}
static void do_view3d_select_object_typemenu(void *arg, int event)
void do_view3d_select_object_typemenu(void *arg, int event)
{
extern void selectall_type(short obtype);
switch(event) {
case 0: /* Mesh */
case 1: /* Mesh */
selectall_type(OB_MESH);
break;
case 1: /* Curve */
case 2: /* Curve */
selectall_type(OB_CURVE);
break;
case 2: /* Surface */
case 3: /* Surface */
selectall_type(OB_SURF);
break;
case 3: /* Meta */
case 4: /* Meta */
selectall_type(OB_MBALL);
break;
case 4: /* Armature */
case 5: /* Armature */
selectall_type(OB_ARMATURE);
break;
case 5: /* Lattice */
case 6: /* Lattice */
selectall_type(OB_LATTICE);
break;
case 6: /* Text */
case 7: /* Text */
selectall_type(OB_FONT);
break;
case 7: /* Empty */
case 8: /* Empty */
selectall_type(OB_EMPTY);
break;
case 8: /* Camera */
case 9: /* Camera */
selectall_type(OB_CAMERA);
break;
case 9: /* Lamp */
case 10: /* Lamp */
selectall_type(OB_LAMP);
break;
}
@ -422,31 +494,30 @@ static uiBlock *view3d_select_object_typemenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_select_object_typemenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
static void do_view3d_select_object_layermenu(void *arg, int event)
void do_view3d_select_object_layermenu(void *arg, int event)
{
extern void selectall_layer(int layernum);
switch(event) {
@ -514,12 +585,70 @@ static uiBlock *view3d_select_object_layermenu(void *arg_unused)
return block;
}
void do_view3d_select_object_linkedmenu(void *arg, int event)
{
switch(event) {
case 1: /* Object Ipo */
case 2: /* ObData */
case 3: /* Current Material */
case 4: /* Current Texture */
selectlinks(event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_select_object_linkedmenu(void *arg_unused)
{
uiBlock *block;
short yco = 20, menuwidth = 120;
block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_linkedmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_select_object_linkedmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Shift L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData|Shift L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Material|Shift L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture|Shift L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
void do_view3d_select_object_groupedmenu(void *arg, int event)
{
switch(event) {
case 1: /* Children */
case 2: /* Immediate Children */
case 3: /* Parent */
case 4: /* Objects on Shared Layers */
select_group((short)event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_select_object_groupedmenu(void *arg_unused)
{
uiBlock *block;
short yco = 20, menuwidth = 120;
block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_groupedmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_select_object_groupedmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Children|Shift G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Immediate Children|Shift G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Parent|Shift G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects on Shared Layers|Shift 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_select_objectmenu(void *arg, int event)
{
// extern void borderselect(void);
// extern void deselectall(void);
switch(event) {
case 0: /* border select */
@ -528,12 +657,6 @@ static void do_view3d_select_objectmenu(void *arg, int event)
case 1: /* Select/Deselect All */
deselectall();
break;
case 2: /* Select Linked */
selectlinks();
break;
case 3: /* Select Grouped */
group_menu();
break;
}
allqueue(REDRAWVIEW3D, 0);
}
@ -556,8 +679,8 @@ static uiBlock *view3d_select_objectmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked...|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grouped...|Shift G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, "");
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
@ -925,6 +1048,48 @@ static uiBlock *view3d_select_faceselmenu(void *arg_unused)
return block;
}
void do_view3d_edit_snapmenu(void *arg, int event)
{
switch(event) {
case 1: /* Selection to grid */
snap_sel_to_grid();
break;
case 2: /* Selection to cursor */
snap_sel_to_curs();
break;
case 3: /* Cursor to grid */
snap_curs_to_grid();
break;
case 4: /* Cursor to selection */
snap_curs_to_sel();
break;
case 5: /* Selection to center of selection*/
snap_to_center();
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_edit_snapmenu(void *arg_unused)
{
uiBlock *block;
short yco = 20, menuwidth = 120;
block= uiNewBlock(&curarea->uiblocks, "view3d_edit_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_edit_snapmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Grid|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Cursor|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Grid|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Selection|Shift S, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Center|Shift S, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
static void do_view3d_edit_object_transformmenu(void *arg, int event)
{
switch(event) {
@ -973,6 +1138,197 @@ static uiBlock *view3d_edit_object_transformmenu(void *arg_unused)
return block;
}
static void do_view3d_edit_object_makelinksmenu(void *arg, int event)
{
switch(event) {
case 1:
case 2:
case 3:
case 4:
make_links((short)event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused)
{
Object *ob;
uiBlock *block;
short yco = 20, menuwidth = 120;
ob= OBACT;
block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_makelinksmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_edit_object_makelinksmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Scene...|Ctrl L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Ctrl L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
if(ob->type==OB_MESH) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
} else if(ob->type==OB_CURVE) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
} else if(ob->type==OB_FONT) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
} else if(ob->type==OB_SURF) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
} else if(ob->type==OB_MBALL) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
} else if(ob->type==OB_CAMERA) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
} else if(ob->type==OB_LAMP) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
} else if(ob->type==OB_LATTICE) {
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, "");
}
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
static void do_view3d_edit_object_singleusermenu(void *arg, int event)
{
switch(event) {
case 1: /* Object */
single_object_users(1);
break;
case 2: /* Object & ObData */
single_object_users(1);
single_obdata_users(1);
break;
case 3: /* Object & ObData & Materials+Tex */
single_object_users(1);
single_obdata_users(1);
single_mat_users(1); /* also tex */
break;
case 4: /* Materials+Tex */
single_mat_users(1);
break;
}
clear_id_newpoins();
countall();
allqueue(REDRAWALL, 0);
}
static uiBlock *view3d_edit_object_singleusermenu(void *arg_unused)
{
Object *ob;
uiBlock *block;
short yco = 20, menuwidth = 120;
ob= OBACT;
block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_singleusermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_edit_object_singleusermenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object|U, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData|U, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData & Materials+Tex|U, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials+Tex|U, 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_edit_object_copyattrmenu(void *arg, int event)
{
switch(event) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
copy_attr((short)event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused)
{
Object *ob;
uiBlock *block;
short yco = 20, menuwidth = 120;
ob= OBACT;
block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_copyattrmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_edit_object_copyattrmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Location|Ctrl C, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotation|Ctrl C, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Size|Ctrl C, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Drawtype|Ctrl C, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Time Offset|Ctrl C, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dupli|Ctrl C, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mass|Ctrl C, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Damping|Ctrl C, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Properties|Ctrl C, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Logic Bricks|Ctrl C, 10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Constraints|Ctrl C, 11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
(ob->type == OB_FONT) || (ob->type == OB_MBALL)) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture Space|Ctrl C, 12", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
}
if(ob->type == OB_FONT) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Font Settings|Ctrl C, 13", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C, 14", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
}
if(ob->type == OB_CURVE) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C, 13", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
}
if(ob->type==OB_MESH) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdiv|Ctrl C, 13", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
}
if( give_parteff(ob) ) {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Particle Settings|Ctrl C, 14", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
}
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
static void do_view3d_edit_object_parentmenu(void *arg, int event)
{
switch(event) {
@ -1056,15 +1412,9 @@ static void do_view3d_edit_objectmenu(void *arg, int event)
adduplicate(0);
G.qual &= ~LR_ALTKEY;
break;
case 4: /* copy linkss */
linkmenu();
break;
case 5: /* make single user */
single_user();
break;
case 6: /* copy properties */
copymenu();
break;
case 7: /* boolean operation */
special_editmenu();
break;
@ -1085,10 +1435,6 @@ static void do_view3d_edit_objectmenu(void *arg, int event)
case 11: /* insert keyframe */
common_insertkey();
break;
case 12: /* snap */
snapmenu();
break;
case 15: /* Object Panel */
add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW);
break;
@ -1105,7 +1451,6 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
//uiDefIconTextBlockBut(block, 0, NULL, ICON_RIGHTARROW_THIN, "Move", 0, yco-=20, 120, 19, "");
//uiDefIconTextBlockBut(block, 0, NULL, ICON_RIGHTARROW_THIN, "Rotate", 0, yco-=20, 120, 19, "");
@ -1113,7 +1458,7 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused)
// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -1127,9 +1472,9 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Links...|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Single User...|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Properties...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, "");
uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -1316,6 +1661,9 @@ void do_view3d_edit_mesh_edgesmenu(void *arg, int event)
case 5: /* Make Edge/Face */
addedgevlak_mesh();
break;
case 6:
bevel_menu();
break;
}
allqueue(REDRAWVIEW3D, 0);
}
@ -1329,7 +1677,10 @@ static uiBlock *view3d_edit_mesh_edgesmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_view3d_edit_mesh_edgesmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop Subdivide...|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Knife Subdivide...|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
@ -1431,6 +1782,52 @@ static uiBlock *view3d_edit_mesh_normalsmenu(void *arg_unused)
return block;
}
void do_view3d_edit_mesh_mirrormenu(void *arg, int event)
{
switch(event) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
mirror(event);
break;
}
allqueue(REDRAWVIEW3D, 0);
}
static uiBlock *view3d_edit_mesh_mirrormenu(void *arg_unused)
{
uiBlock *block;
short yco = 20, menuwidth = 120;
block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_view3d_edit_mesh_mirrormenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|M, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|M, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|M, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X View|M, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y View|M, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z View|M, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 60);
return block;
}
static void do_view3d_edit_mesh_showhidemenu(void *arg, int event)
@ -1467,6 +1864,7 @@ static uiBlock *view3d_edit_mesh_showhidemenu(void *arg_unused)
uiTextBoundsBlock(block, 60);
return block;
}
static void do_view3d_edit_meshmenu(void *arg, int event)
{
switch(event) {
@ -1480,9 +1878,6 @@ static void do_view3d_edit_meshmenu(void *arg, int event)
case 2: /* transform properties */
add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, 0);
break;
case 3: /* snap */
snapmenu();
break;
case 4: /* insert keyframe */
common_insertkey();
break;
@ -1533,7 +1928,7 @@ static uiBlock *view3d_edit_meshmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -1555,6 +1950,7 @@ static uiBlock *view3d_edit_meshmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBlockBut(block, view3d_edit_mesh_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Shift W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
@ -1667,7 +2063,7 @@ static uiBlock *view3d_edit_curve_segmentsmenu(void *arg_unused)
return block;
}
static void do_view3d_edit_curve_showhidemenu(void *arg, int event)
void do_view3d_edit_curve_showhidemenu(void *arg, int event)
{
switch(event) {
case 10: /* show hidden control points */
@ -1743,9 +2139,6 @@ static void do_view3d_edit_curvemenu(void *arg, int event)
case 14: /* Warp */
transform('w');
break;
case 15: /* snap */
snapmenu();
break;
}
allqueue(REDRAWVIEW3D, 0);
}
@ -1763,7 +2156,7 @@ static uiBlock *view3d_edit_curvemenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -2009,9 +2402,6 @@ static void do_view3d_edit_latticemenu(void *arg, int event)
case 0: /* Undo Editing */
remake_editLatt();
break;
case 1: /* snap */
snapmenu();
break;
case 2: /* insert keyframe */
common_insertkey();
break;
@ -2041,7 +2431,7 @@ static uiBlock *view3d_edit_latticemenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -2083,9 +2473,6 @@ static void do_view3d_edit_armaturemenu(void *arg, int event)
case 1: /* transformation properties */
mainqenter(NKEY, 1);
break;
case 2: /* snap */
snapmenu();
break;
case 3: /* extrude */
extrude_armature();
break;
@ -2118,7 +2505,7 @@ static uiBlock *view3d_edit_armaturemenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@ -2528,12 +2915,13 @@ static void do_view3d_faceselmenu(void *arg, int event)
case 3: /* clear vertex colors */
clear_vpaint_selectedfaces();
break;
// case 3: /* uv calculation */
// uv_autocalc_tface();
// break;
case 8: /* uv calculation */
uv_autocalc_tface();
break;
case 7: /* rotate UVs */
rotate_uv_tface();
break;
}
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSLOGIC, 0);
@ -2553,19 +2941,19 @@ static uiBlock *view3d_faceselmenu(void *arg_unused)
uiDefIconTextBlockBut(block, view3d_facesel_propertiesmenu, NULL, ICON_RIGHTARROW_THIN, "Active Draw Mode", 0, yco-=20, 120, 19, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Draw Mode", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
/* for some reason calling this from the header messes up the 'from window'
* UV calculation :(
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unwrap UVs", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
*/
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate UVs|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy UVs & Textures", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
/* for some reason calling this from the header messes up the 'from window'
* UV calculation :(
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Calculate UVs", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
*/
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate UVs|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBlockBut(block, view3d_facesel_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Faces", 0, yco-=20, 120, 19, "");

@ -442,7 +442,7 @@ static void changeview3dspace(ScrArea *sa, void *spacedata)
*/
static void align_view_to_selected(View3D *v3d)
{
int nr= pupmenu("Align view%t|To selection (top)%x2|To selection (front)%x1|To selection (side)%x0");
int nr= pupmenu("Align View%t|To Selected (top)%x2|To Selected (front)%x1|To Selected (side)%x0");
if (nr!=-1) {
int axis= nr;
@ -501,24 +501,31 @@ void select_parent(void) /* Makes parent active and de-selected OBACT */
set_active_base(basact);
}
void group_menu(void)
void select_group_menu(void)
{
Base *base;
short nr;
char *str;
short nr;
/* make menu string */
str= MEM_mallocN(160, "groupmenu");
strcpy(str, "Group selection%t|Children%x1|"
"Immediate children%x2|Parent%x3|"
"Objects on shared layers%x4");
strcpy(str, "Select Grouped%t|Children%x1|"
"Immediate Children%x2|Parent%x3|"
"Objects on Shared Layers%x4");
/* here we go */
nr= pupmenu(str);
MEM_freeN(str);
select_group(nr);
}
void select_group(short nr)
{
Base *base;
if(nr==4) {
base= FIRSTBASE;
while(base) {
@ -559,7 +566,6 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if(event==UI_BUT_EVENT) do_butspace(val); // temporal, view3d deserves own queue?
/* TEXTEDITING?? */
if((G.obedit) && G.obedit->type==OB_FONT) {
switch(event) {
@ -913,7 +919,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case CKEY:
if(G.qual==LR_CTRLKEY) {
copymenu();
copy_attr_menu();
}
else if(G.qual==LR_ALTKEY) {
convertmenu(); /* editobject.c */
@ -1008,7 +1014,7 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else if(G.qual & LR_ALTKEY) rem_selected_from_group(); */
if((G.qual==LR_SHIFTKEY))
group_menu();
select_group_menu();
else if(G.qual==LR_ALTKEY)
clear_object('g');
else if((G.qual==0))
@ -1124,9 +1130,9 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
else {
if((G.qual==LR_SHIFTKEY))
selectlinks();
selectlinks_menu();
else if(G.qual==LR_CTRLKEY)
linkmenu();
make_links_menu();
else if(G.f & G_FACESELECT)
select_linked_tfaces();
else if((G.qual==0))
@ -1655,7 +1661,7 @@ void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case JKEY:
if((G.qual==0))
join_ipo();
join_ipo_menu();
break;
case KKEY:
if((G.qual==0)) {
@ -1674,9 +1680,9 @@ void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
ipo_record();
break;
case SKEY:
if((G.qual==LR_SHIFTKEY))
ipo_snapmenu();
else if((G.qual==0))
if((G.qual==LR_SHIFTKEY)) {
ipo_snap_menu();
} else if((G.qual==0))
transform_ipo('s');
break;
case TKEY:

@ -1519,6 +1519,7 @@ ListBase tb_listb= {NULL, NULL};
#define TB_ALT 512
#define TB_CTRL 1024
#define TB_PAD 2048
#define TB_SHIFT 4096
typedef struct TBitem {
int icon;
@ -1539,6 +1540,10 @@ static void tb_do_hotkey(void *arg, int event)
qual1= LEFTALTKEY;
event &= ~TB_ALT;
}
if(event & TB_SHIFT) {
qual1= LEFTSHIFTKEY;
event &= ~TB_SHIFT;
}
if(event & TB_TAB) key= TABKEY;
else if(event & TB_PAD) {
@ -1568,13 +1573,84 @@ static void tb_do_hotkey(void *arg, int event)
/* *************Select ********** */
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
static TBitem tb_object_select_layer1_5[]= {
{ 0, "1", 1, NULL},
{ 0, "2", 2, NULL},
{ 0, "3", 3, NULL},
{ 0, "4", 4, NULL},
{ 0, "5", 5, NULL},
{ -1, "", 0, do_view3d_select_object_layermenu}};
static TBitem tb_object_select_layer6_10[]= {
{ 0, "6", 6, NULL},
{ 0, "7", 7, NULL},
{ 0, "8", 8, NULL},
{ 0, "9", 9, NULL},
{ 0, "10", 10, NULL},
{ -1, "", 0, do_view3d_select_object_layermenu}};
static TBitem tb_object_select_layer11_15[]= {
{ 0, "11", 11, NULL},
{ 0, "12", 12, NULL},
{ 0, "13", 13, NULL},
{ 0, "14", 14, NULL},
{ 0, "15", 15, NULL},
{ -1, "", 0, do_view3d_select_object_layermenu}};
static TBitem tb_object_select_layer16_20[]= {
{ 0, "16", 16, NULL},
{ 0, "17", 17, NULL},
{ 0, "18", 18, NULL},
{ 0, "19", 19, NULL},
{ 0, "20", 20, NULL},
{ -1, "", 0, do_view3d_select_object_layermenu}};
static TBitem tb_object_select_layer[]= {
{ 0, "Layers 1-5", 0, tb_object_select_layer1_5},
{ 0, "Layers 6-10", 0, tb_object_select_layer6_10},
{ 0, "Layers 11-15", 0, tb_object_select_layer11_15},
{ 0, "Layers 16-20", 0, tb_object_select_layer16_20},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_object_select_type[]= {
{ 0, "Mesh", 1, NULL},
{ 0, "Curve", 2, NULL},
{ 0, "Surface", 3, NULL},
{ 0, "Meta", 4, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Armature", 5, NULL},
{ 0, "Lattice", 6, NULL},
{ 0, "Text", 7, NULL},
{ 0, "Empty", 8, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Camera", 9, NULL},
{ 0, "Lamp", 10, NULL},
{ -1, "", 0, do_view3d_select_object_typemenu}};
static TBitem tb_object_select_linked[]= {
{ 0, "Object Ipo|Shift L, 1", 1, NULL},
{ 0, "ObData|Shift L, 2", 2, NULL},
{ 0, "Material|Shift L, 3", 3, NULL},
{ 0, "Texture|Shift L, 4", 4, NULL},
{ -1, "", 0, do_view3d_select_object_linkedmenu}};
static TBitem tb_object_select_grouped[]= {
{ 0, "Children|Shift G, 1", 1, NULL},
{ 0, "Immediate Children|Shift G, 2", 2, NULL},
{ 0, "Parent|Shift G, 3", 3, NULL},
{ 0, "Objects on Shared Layers|Shift G, 4", 4, NULL},
{ -1, "", 0, do_view3d_select_object_groupedmenu}};
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Select/Deselect All|A", 'a', NULL},
{ 0, "Select All by Layer", 0, tb_object_select_layer},
{ 0, "Select All by Type", 0, tb_object_select_type},
{ 0, "SEPR", 0, NULL},
{ 0, "Linked", 0, tb_object_select_linked},
{ 0, "Grouped", 0, tb_object_select_grouped},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_mesh_select[]= {
{ 0, "Border Select|B", 0, NULL},
@ -1585,8 +1661,8 @@ static TBitem tb_mesh_select[]= {
{ 0, "Random...", 5, NULL},
{ 0, "Non-Manifold|Shift Ctrl Alt M", 9, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "More|Ctrl Numpad +", 7, NULL},
{ 0, "Less|Ctrl Numpad -", 8, NULL},
{ 0, "More|Ctrl NumPad +", 7, NULL},
{ 0, "Less|Ctrl NumPad -", 8, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Face Loop...|Shift R", 6, NULL},
{ 0, "Linked Vertices|Ctrl L", 4, NULL},
@ -1613,12 +1689,6 @@ static TBitem tb_edit[]= {
{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_edit_hide[]= {
{ 0, "Show Hidden|Alt H", TB_ALT|'h', NULL},
{ 0, "Hide Selected|H", 'h', NULL},
{ 0, "Hide Deselected|Shift H", 'H', NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_curve_edit_seg[]= {
{ 0, "Subdivide", 0, NULL},
{ 0, "Switch directoin", 1, NULL},
@ -1638,14 +1708,15 @@ static TBitem tb_curve_edit_cv[]= {
static TBitem tb_curve_edit[]= {
{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Extrude|E", 'e', NULL},
{ 0, "Duplicate|Shift D", 'D', NULL},
{ 0, "Make Segment|F", 'f', NULL},
{ 0, "Toggle Cyclic|F", 'c', NULL},
{ 0, "Delete...|X", 'x', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Control Points", 0, tb_curve_edit_cv},
{ 0, "Segments", 0, tb_curve_edit_seg},
{ 0, "SEPR", 0, NULL},
{ 0, "Show/Hide", 0, tb_edit_hide},
{ -1, "", 0, tb_do_hotkey}};
@ -1653,13 +1724,17 @@ static TBitem tb_mesh_edit_vertex[]= {
{ 0, "Merge...|Alt M", 5, NULL},
{ 0, "Split|Y", 4, NULL},
{ 0, "Separate|P", 3, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Smooth|Alt M", 2, NULL},
{ 0, "Remove Doubles|Alt M", 1, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Make Vertex Parent|Ctrl P", 0, NULL},
{ -1, "", 0, do_view3d_edit_mesh_verticesmenu}};
static TBitem tb_mesh_edit_edge[]= {
{ 0, "Make Edge/Face|F", 5, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Bevel", 6, NULL},
{ 0, "Loop Subdivide|Ctrl R", 4, NULL},
{ 0, "Knife Subdivide...|Shift K", 3, NULL},
{ 0, "SEPR", 0, NULL},
@ -1672,6 +1747,7 @@ static TBitem tb_mesh_edit_face[]= {
{ 0, "Make Edge/Face|F", 'f', NULL},
{ 0, "Fill|Shift F", 'F', NULL},
{ 0, "Beaty Fill|Alt F", TB_ALT|'f', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Convert to Triangles|Ctrl T", TB_CTRL|'t', NULL},
{ 0, "Convert to Quads|Alt J", TB_ALT|'j', NULL},
{ 0, "Flip Triangle Edges|Ctrl F", TB_CTRL|'f', NULL},
@ -1679,23 +1755,25 @@ static TBitem tb_mesh_edit_face[]= {
static TBitem tb_mesh_edit_normal[]= {
{ 0, "Recalculate Outside", 2, NULL},
{ 0, "Recalculate Inside", 1, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Flip", 0, NULL},
{ 0, "Recalc Inside", 1, NULL},
{ 0, "Recalc Outside", 2, NULL},
{ -1, "", 0, do_view3d_edit_mesh_normalsmenu}};
static TBitem tb_mesh_edit[]= {
{ 0, "Exit Editmode|Tab", TB_TAB, NULL},
{ 0, "Undo|U", 'u', NULL},
{ 0, "Redo|Shift U", 'U', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Extrude|E", 'e', NULL},
{ 0, "Duplicate|Shift D", 'D', NULL},
{ 0, "Delete...|X", 'x', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Vertices", 0, tb_mesh_edit_vertex},
{ 0, "Edges", 0, tb_mesh_edit_edge},
{ 0, "Faces", 0, tb_mesh_edit_face},
{ 0, "Normals", 0, tb_mesh_edit_normal},
{ 0, "SEPR", 0, NULL},
{ 0, "Show/Hide", 0, tb_edit_hide},
{ -1, "", 0, tb_do_hotkey}};
@ -1709,63 +1787,89 @@ static TBitem tb_object_ipo[]= {
static TBitem tb_object_edit[]= {
{ 0, "Enter Editmode|Tab", TB_TAB, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Insert Key...|I", 'i', NULL},
{ 0, "Object Keys", 0, tb_object_ipo},
{ 0, "Duplicate|Shift D", 'D', NULL},
{ 0, "Duplicate Linked|Alt D", TB_ALT|'d', NULL},
{ 0, "Delete|X", 'x', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Boolean...|W", 'w', NULL},
{ 0, "Join Objects|Ctrl J", TB_CTRL|'j', NULL},
{ 0, "Convert Object...|Alt C", TB_ALT|'c', NULL},
{ 0, "Object Keys", 0, tb_object_ipo},
{ -1, "", 0, tb_do_hotkey}};
/* ************* Type ********** */
static TBitem tb_obdata_hide[]= {
{ 0, "Show Hidden|Alt H", TB_ALT|'h', NULL},
{ 0, "Hide Selected|H", 'h', NULL},
{ 0, "Hide Deselected|Shift H", 'H', NULL},
{ -1, "", 0, tb_do_hotkey}};
static void tb_do_mesh(void *arg, int event){
Mesh *me= get_mesh(OBACT);
switch(event) {
case 1: duplicate_context_selected(); break;
case 2: delete_context_selected(); break;
case 3: G.f ^= G_DRAWEDGES; break;
case 4: G.f ^= G_DRAWFACES; break;
case 5: G.f ^= G_DRAWNORMALS; break;
case 6: me->flag ^= ME_SUBSURF; makeDispList(OBACT); break;
case 7: me->flag ^= ME_OPT_EDGES; makeDispList(OBACT); break;
case 1: common_insertkey(); break;
case 2: G.f ^= G_DRAWEDGES; break;
case 3: G.f ^= G_DRAWFACES; break;
case 4: G.f ^= G_DRAWNORMALS; break;
case 5: me->flag ^= ME_SUBSURF; makeDispList(OBACT); break;
case 6: me->flag ^= ME_OPT_EDGES; makeDispList(OBACT); break;
}
addqueue(curarea->win, REDRAW, 1);
}
static TBitem tb_mesh[]= {
{ 0, "Duplicate|Shift D", 1, NULL},
{ 0, "Delete|X", 2, NULL},
{ 0, "Insert Keyframe|I", 1, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Show/Hide Edges", 3, NULL},
{ 0, "Show/Hide Faces", 4, NULL},
{ 0, "Show/Hide Normals", 5, NULL},
{ 0, "Show/Hide Edges", 2, NULL},
{ 0, "Show/Hide Faces", 3, NULL},
{ 0, "Show/Hide Normals", 4, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Subdivision Surface", 6, NULL},
{ 0, "Subd.Surf. Optimal", 7, NULL},
{ 0, "Subdivision Surface", 5, NULL},
{ 0, "SubSurf Optimal", 6, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Show/Hide Vertices", 0, tb_obdata_hide},
{ -1, "", 0, tb_do_mesh}};
static TBitem tb_curve_hide[]= {
{ 0, "Show Hidden|Alt H", 10, NULL},
{ 0, "Hide Selected|H", 11, NULL},
{ -1, "", 0, do_view3d_edit_curve_showhidemenu}};
static TBitem tb_curve[]= {
{ 0, "Insert Keyframe|I", 'i', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Show/Hide Points", 0, tb_curve_hide},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_obdata[]= {
{ 0, "Duplicate|Shift D", 'D', NULL},
{ 0, "Delete|X", 'x', NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_object_parent[]= {
{ 0, "Make Parent...|Ctrl P", TB_CTRL|'p', NULL},
{ 0, "Clear Parent...|Alt P", TB_ALT|'p', NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_object[]= {
{ 0, "Duplicate|Shift D", 'D', NULL},
{ 0, "Duplicate Linked|Alt D", TB_ALT|'D', NULL},
{ 0, "Delete|X", 'x', NULL},
{ 0, "Copy Links...|Ctrl L", TB_CTRL|'l', NULL},
{ 0, "Make Single User...|U", 'u', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Make Parent|Ctrl P", TB_CTRL|'p', NULL},
{ 0, "Clear Parent|Alt P", TB_ALT|'p', NULL},
static TBitem tb_object_track[]= {
{ 0, "Make Track|Ctrl T", TB_CTRL|'t', NULL},
{ 0, "Clear Track|Alt T", TB_ALT|'t', NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_object[]= {
{ 0, "Insert Keyframe|I", 'i', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Copy Links...|Ctrl L", TB_CTRL|'l', NULL},
{ 0, "Make Single User...|U", 'u', NULL},
{ 0, "Copy Properties...|Ctrl C", TB_CTRL|'c', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Parent", 0, tb_object_parent},
{ 0, "Track", 0, tb_object_track},
{ 0, "SEPR", 0, NULL},
{ 0, "Boolean Operation|W", 'w', NULL},
{ 0, "Join Objects...|Ctrl J", TB_CTRL|'j', NULL},
{ 0, "Convert Object Type...|Alt C", TB_ALT|'c', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Move to Layer...|M", 'm', NULL},
{ -1, "", 0, tb_do_hotkey}};
@ -1778,65 +1882,263 @@ static void tb_do_view_dt(void *arg, int event){
}
static TBitem tb_view_dt[]= {
{ ICON_BBOX, "Bounding box", 1, NULL},
{ ICON_BBOX, "Bounding Box", 1, NULL},
{ ICON_WIRE, "Wireframe", 2, NULL},
{ ICON_SOLID, "Solid", 3, NULL},
{ ICON_SMOOTH, "Shaded", 5, NULL},
{ ICON_POTATO, "Textured", 5, NULL},
{ -1, "", 0, tb_do_view_dt}};
static TBitem tb_view_alignview[]= {
{ 0, "Centre View to Cursor|C", 'c', NULL},
{ 0, "Align Active Camera to View|Shift NumPad 0", TB_SHIFT|TB_PAD|'0', NULL},
{ 0, "Align View to Selected|NumPad *", TB_PAD|'*', NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_view[]= {
{ 0, "Viewport Shading", 0, tb_view_dt},
{ 0, "SEPR", 0, NULL},
{ 0, "Ortho/Persp|Pad 5", TB_PAD|'5', NULL},
{ 0, "Local View|Pad /", TB_PAD|'/', NULL},
{ 0, "Frame All|Home", TB_PAD|'h', NULL},
{ 0, "Frame Selected|Pad .", TB_PAD|'.', NULL},
{ 0, "Centre Cursor|C", 'c', NULL},
{ 0, "Ortho/Perspective|NumPad 5", TB_PAD|'5', NULL},
{ 0, "Local/Global View|NumPad /", TB_PAD|'/', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Play Back |Alt A", TB_ALT|'a', NULL},
{ 0, "Align View", 0, tb_view_alignview},
{ 0, "SEPR", 0, NULL},
{ 0, "View Selected|NumPad .", TB_PAD|'.', NULL},
{ 0, "View All|Home", TB_PAD|'h', NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Play Back Animation|Alt A", TB_ALT|'a', NULL},
{ -1, "", 0, tb_do_hotkey}};
/* *************TRANSFORM ********** */
static void tb_do_transform_moveaxis(void *arg, int event)
{
switch(event)
{
case 0: /* X Global */
transform('g'*'X');
break;
case 1: /* Y Global */
transform('g'*'Y');
break;
case 2: /* Z Global */
transform('g'*'Z');
break;
case 3: /* X Local */
transform('g'*'x');
break;
case 4: /* Y Local */
transform('g'*'y');
break;
case 5: /* Z Local */
transform('g'*'z');
break;
}
}
static TBitem tb_transform_moveaxis[]= {
{ 0, "X Global|G, X", 0, NULL},
{ 0, "Y Global|G, Y", 1, NULL},
{ 0, "Z Global|G, Z", 2, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "X Local|G, X, X", 3, NULL},
{ 0, "Y Local|G, Y, Y", 4, NULL},
{ 0, "Z Local|G, Z, Z", 5, NULL},
{ -1, "", 0, tb_do_transform_moveaxis}};
static void tb_do_transform_rotateaxis(void *arg, int event)
{
switch(event)
{
case 0: /* X Global */
transform('r'*'X');
break;
case 1: /* Y Global */
transform('r'*'Y');
break;
case 2: /* Z Global */
transform('r'*'Z');
break;
case 3: /* X Local */
transform('r'*'x');
break;
case 4: /* Y Local */
transform('r'*'y');
break;
case 5: /* Z Local */
transform('r'*'z');
break;
}
}
static TBitem tb_transform_rotateaxis[]= {
{ 0, "X Global|G, X", 0, NULL},
{ 0, "Y Global|G, Y", 1, NULL},
{ 0, "Z Global|G, Z", 2, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "X Local|G, X, X", 3, NULL},
{ 0, "Y Local|G, Y, Y", 4, NULL},
{ 0, "Z Local|G, Z, Z", 5, NULL},
{ -1, "", 0, tb_do_transform_rotateaxis}};
static void tb_do_transform_scaleaxis(void *arg, int event)
{
switch(event)
{
case 0: /* X Global */
transform('s'*'X');
break;
case 1: /* Y Global */
transform('s'*'Y');
break;
case 2: /* Z Global */
transform('s'*'Z');
break;
case 3: /* X Local */
transform('s'*'x');
break;
case 4: /* Y Local */
transform('s'*'y');
break;
case 5: /* Z Local */
transform('s'*'z');
break;
}
}
static TBitem tb_transform_scaleaxis[]= {
{ 0, "X Global|G, X", 0, NULL},
{ 0, "Y Global|G, Y", 1, NULL},
{ 0, "Z Global|G, Z", 2, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "X Local|G, X, X", 3, NULL},
{ 0, "Y Local|G, Y, Y", 4, NULL},
{ 0, "Z Local|G, Z, Z", 5, NULL},
{ -1, "", 0, tb_do_transform_scaleaxis}};
static void tb_do_transform_clearapply(void *arg, int event)
{
switch(event)
{
case 0: /* clear location */
clear_object('g');
break;
case 1: /* clear rotation */
clear_object('r');
break;
case 2: /* clear size */
clear_object('s');
break;
case 3: /* apply size/rotation */
apply_object();
break;
case 4: /* apply deformation */
make_duplilist_real();
break;
}
}
static TBitem tb_transform_clearapply[]= {
{ 0, "Clear Location", 0, NULL},
{ 0, "Clear Rotation", 1, NULL},
{ 0, "Clear Size", 2, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Apply Size/Rotation|Ctrl A", 3, NULL},
{ 0, "Apply Deform|Shift Ctrl A", 4, NULL},
{ -1, "", 0, tb_do_transform_clearapply}};
static TBitem tb_transform_snap[]= {
{ 0, "Selection -> Grid|Shift S, 1", 1, NULL},
{ 0, "Selection -> Cursor|Shift S, 2", 2, NULL},
{ 0, "Cursor -> Grid|Shift S, 3", 3, NULL},
{ 0, "Cursor -> Selection|Shift S, 4", 4, NULL},
{ 0, "Selection -> Center|Shift S, 5", 5, NULL},
{ -1, "", 0, do_view3d_edit_snapmenu}};
static void tb_do_transform(void *arg, int event)
{
switch(event)
{
case 0: /* Grab/move */
transform('g');
break;
case 1: /* Rotate */
transform('r');
break;
case 2: /* Scale */
transform('s');
break;
case 3: /* transform properties */
mainqenter(NKEY, 1);
break;
case 4: /* snap */
snapmenu();
break;
}
}
static TBitem tb_transform[]= {
{ 0, "Grabber|g", 'g', NULL},
{ 0, "Rotate|r", 'r', NULL},
{ 0, "Scale|s", 's', NULL},
{ 0, "Grab/Move|G", 0, NULL},
{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
{ 0, "Rotate|R", 1, NULL},
{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
{ 0, "Scale|S", 2, NULL},
{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
{ 0, "SEPR", 0, NULL},
{ ICON_MENU_PANEL, "Properties|n", 'n', NULL},
{ 0, "Snap...|Shift S", 'S', NULL},
{ ICON_MENU_PANEL, "Properties|N", 3, NULL},
{ 0, "Snap", 0, tb_transform_snap},
{ 0, "SEPR", 0, NULL},
{ 0, "Clear Location", TB_ALT|'g', NULL},
{ 0, "Clear Rotation", TB_ALT|'r', NULL},
{ 0, "Clear Size", TB_ALT|'s', NULL},
{ 0, "Apply Rot/Size|Ctrl A", TB_CTRL|'a', NULL},
{ 0, "Apply Deform|Shift Ctrl A", TB_CTRL|'A', NULL},
{ -1, "", 0, tb_do_hotkey}};
{ 0, "Clear/Apply", 0, tb_transform_clearapply},
{ -1, "", 0, tb_do_transform}};
static TBitem tb_transform_mirror[]= {
{ 0, "X Global|M, 1", 1, NULL},
{ 0, "Y Global|M, 2", 2, NULL},
{ 0, "Z Global|M, 3", 3, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "X Local|M, 4", 4, NULL},
{ 0, "Y Local|M, 5", 5, NULL},
{ 0, "Z Local|M, 6", 6, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "X View|M, 7", 7, NULL},
{ 0, "Y View|M, 8", 8, NULL},
{ 0, "Z View|M, 9", 9, NULL},
{ -1, "", 0, do_view3d_edit_mesh_mirrormenu}};
static TBitem tb_transform_editmode1[]= {
{ 0, "Grabber|g", 'g', NULL},
{ 0, "Rotate|r", 'r', NULL},
{ 0, "Scale|s", 's', NULL},
{ 0, "Grab/Move|G", 0, NULL},
{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
{ 0, "Rotate|R", 1, NULL},
{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
{ 0, "Scale|S", 2, NULL},
{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
{ 0, "SEPR", 0, NULL},
{ 0, "Mirror", 0, tb_transform_mirror},
{ 0, "Shrink/Fatten|Alt S", TB_ALT|'s', NULL},
{ 0, "Shear|Ctrl S", TB_CTRL|'s', NULL},
{ 0, "Warp|Shift W", 'W', NULL},
{ 0, "SEPR", 0, NULL},
{ ICON_MENU_PANEL, "Properties|n", 'n', NULL},
{ 0, "Snap...|Shift S", 'S', NULL},
{ 0, "Snap", 0, tb_transform_snap},
{ 0, "SEPR", 0, NULL},
{ 0, "Proportional Edit|O", 'o', NULL},
{ -1, "", 0, tb_do_hotkey}};
static TBitem tb_transform_editmode2[]= {
{ 0, "Grabber|g", 'g', NULL},
{ 0, "Rotate|r", 'r', NULL},
{ 0, "Scale|s", 's', NULL},
{ 0, "Grab/Move|G", 0, NULL},
{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis},
{ 0, "Rotate|R", 1, NULL},
{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis},
{ 0, "Scale|S", 2, NULL},
{ 0, "Scale on Axis", 0, tb_transform_scaleaxis},
{ 0, "SEPR", 0, NULL},
{ ICON_MENU_PANEL, "Properties|n", 'n', NULL},
{ 0, "Snap...|Shift S", 'S', NULL},
{ 0, "Snap", 0, tb_transform_snap},
{ -1, "", 0, tb_do_hotkey}};
@ -1851,6 +2153,7 @@ static TBitem addmenu_mesh[]= {
{ 0, "Cylinder", 5, NULL},
{ 0, "Tube", 6, NULL},
{ 0, "Cone", 7, NULL},
{ 0, "SEPR", 0, NULL},
{ 0, "Grid", 8, NULL},
{ 0, "Monkey", 9, NULL},
{ -1, "", 0, do_info_add_meshmenu}};
@ -1889,7 +2192,7 @@ static TBitem tb_add[]= {
{ 0, "Mesh", 0, addmenu_mesh},
{ 0, "Curve", 1, addmenu_curve},
{ 0, "Surface", 2, addmenu_surf},
{ 0, "MBall", 3, addmenu_meta},
{ 0, "Meta", 3, addmenu_meta},
{ 0, "Text", 4, NULL},
{ 0, "Empty", 5, NULL},
{ 0, "SEPR", 0, NULL},
@ -1932,17 +2235,17 @@ static uiBlock *tb_makemenu(void *arg)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, 50, 6, NULL, 0.0, 0.0, 0, 0, "");
}
else if(item->icon) {
uiDefIconTextBut(block, BUTM, 1, item->icon, item->name, 0, yco-=20, 50, 19, NULL, 0.0, 0.0, 0, item->retval, "");
uiDefIconTextBut(block, BUTM, 1, item->icon, item->name, 0, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, "");
}
else if(item->poin) {
uiDefIconTextBlockBut(block, tb_makemenu, item->poin, ICON_RIGHTARROW_THIN, item->name, 0, yco-=20, 50, 19, "");
uiDefIconTextBlockBut(block, tb_makemenu, item->poin, ICON_RIGHTARROW_THIN, item->name, 0, yco-=20, 80, 19, "");
}
else {
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, item->name, 0, yco-=20, 50, 19, NULL, 0.0, 0.0, 0, item->retval, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, item->name, 0, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, "");
}
item++;
}
uiTextBoundsBlock(block, 50);
uiTextBoundsBlock(block, 80);
/* direction is also set in the function that calls this */
uiBlockSetDirection(block, UI_RIGHT|UI_CENTRE);
@ -1994,7 +2297,7 @@ void toolbox_n(void)
menu5= tb_transform_editmode1;
}
else if(G.obedit->type==OB_CURVE) {
menu1= tb_obdata; str1= "Curve";
menu1= tb_curve; str1= "Curve";
menu2= addmenu_curve;
menu3= tb_curve_select;
menu4= tb_curve_edit;