* Bug fix in view3d menus - wasn't checking a pointer's initialisation strictly enough.

This commit is contained in:
Matt Ebb 2004-01-14 15:51:37 +00:00
parent 3cfa085a46
commit c1a1ba93ae
2 changed files with 55 additions and 61 deletions

@ -1943,7 +1943,7 @@ void copy_attr_menu()
*/
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;
if(!(ob=OBACT)) return;
strcat (str, "|Object Constraints%x22");
@ -1975,9 +1975,8 @@ void copy_attr(short event)
if(G.scene->id.lib) return;
ob= OBACT;
if(!(ob=OBACT)) return;
if(OBACT==0) return;
if(G.obedit) {
/* obedit_copymenu(); */
return;
@ -2184,8 +2183,7 @@ void make_links_menu()
short event=0;
char str[140];
if(OBACT==0) return;
ob= OBACT;
if(!(ob=OBACT)) return;
strcpy(str, "Make Links %t|To Scene...%x1|%l|Object Ipo%x4");
@ -2226,8 +2224,7 @@ void make_links(short event)
short *totcolp, nr;
char *strp;
if(OBACT==0) return;
ob= OBACT;
if(!(ob=OBACT)) return;
if(event==1) {
IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), 0, &nr);

@ -1153,13 +1153,11 @@ static void do_view3d_edit_object_makelinksmenu(void *arg, int event)
static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused)
{
Object *ob;
Object *ob=NULL;
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);
@ -1169,6 +1167,8 @@ static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused)
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=OBACT)) {
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, "");
@ -1192,6 +1192,7 @@ static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused)
} 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);
@ -1226,13 +1227,10 @@ static void do_view3d_edit_object_singleusermenu(void *arg, int event)
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);
@ -1274,13 +1272,11 @@ static void do_view3d_edit_object_copyattrmenu(void *arg, int event)
static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused)
{
Object *ob;
Object *ob=NULL;
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);
@ -1302,6 +1298,8 @@ static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused)
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= OBACT)) {
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, "");
@ -1322,6 +1320,7 @@ static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused)
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);
@ -2872,12 +2871,10 @@ static void do_view3d_faceselmenu(void *arg, int event)
{
/* code copied from buttons.c :(
would be nice if it was split up into functions */
Mesh *me;
Object *ob;
Mesh *me=NULL;
Object *ob=NULL;
extern TFace *lasttface; /* caches info on tface bookkeeping ?*/
ob= OBACT;
switch(event) {
case 0: /* copy draw mode */
case 1: /* copy UVs */