fixed some more screenupdate issues and eliminated a crash

when trying tio shear/warp not visible objects. (thanks Matt)
This commit is contained in:
2003-05-13 14:22:28 +00:00
parent e6ea8d356e
commit 83b5ef6523
8 changed files with 64 additions and 45 deletions

View File

@@ -1522,11 +1522,8 @@ void add_primitiveArmature(int type)
}; };
countall(); countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWALL, 0);
allqueue(REDRAWBUTSHEAD, 0);
allqueue(REDRAWBUTSCONSTRAINT, 0);
allqueue(REDRAWNLA, 0);
} }
static void add_bone_input (Object *ob) static void add_bone_input (Object *ob)

View File

@@ -3796,10 +3796,8 @@ void add_primitiveCurve(int stype)
BLI_addtail(&editNurb, nu); BLI_addtail(&editNurb, nu);
makeDispList(G.obedit); makeDispList(G.obedit);
allqueue(REDRAWBUTSALL, 0);
countall(); countall();
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWALL, 0);
} }
void add_primitiveNurb(int type) void add_primitiveNurb(int type)
@@ -3829,10 +3827,8 @@ void add_primitiveNurb(int type)
BLI_addtail(&editNurb,nu); BLI_addtail(&editNurb,nu);
makeDispList(G.obedit); makeDispList(G.obedit);
allqueue(REDRAWBUTSALL, 0);
countall(); countall();
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWALL, 0);
} }

View File

@@ -626,8 +626,8 @@ void add_primitiveFont(int dummy_argument)
cu->pos= 4; cu->pos= 4;
make_editText(); make_editText();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWALL, 0);
} }
void to_upper(void) void to_upper(void)

View File

@@ -181,8 +181,7 @@ void add_primitiveMball(int dummy_argument)
lastelem= ml; lastelem= ml;
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWALL, 0);
allqueue(REDRAWBUTSALL, 0);
makeDispList(G.obedit); makeDispList(G.obedit);
} }

View File

@@ -4535,11 +4535,9 @@ void add_primitiveMesh(int type)
if(type!=0 && type!=10) righthandfaces(1); if(type!=0 && type!=10) righthandfaces(1);
countall(); countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWALL, 0);
makeDispList(G.obedit); makeDispList(G.obedit);
if (type==13) notice("Oooh Oooh Oooh"); if (type==13) notice("Oooh Oooh Oooh");

View File

@@ -208,11 +208,9 @@ void add_object_draw(int type) /* for toolbox */
} }
redraw_test_buttons(BASACT); redraw_test_buttons(BASACT);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWBUTSEDIT, 0); allqueue(REDRAWALL, 0);
allqueue(REDRAWACTION,0);
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWNLA, 0);
deselect_all_area_oops(); deselect_all_area_oops();
set_select_flag_oops(); set_select_flag_oops();
allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */

View File

@@ -2780,6 +2780,9 @@ static void do_info_editmenu(void *arg, int event)
if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) { if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) {
error("Only editable 3D objects can be sheared"); error("Only editable 3D objects can be sheared");
} }
else if ((base->lay & G.vd->lay)==0) {
error("Only objects on visible layers can be sheared");
}
else { else {
if (!G.obedit) { if (!G.obedit) {
enter_editmode(); enter_editmode();
@@ -2805,6 +2808,9 @@ static void do_info_editmenu(void *arg, int event)
if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) { if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) {
error("Only editable 3D objects can be warped"); error("Only editable 3D objects can be warped");
} }
else if ((base->lay & G.vd->lay)==0) {
error("Only objects on visible layers can be warped");
}
else { else {
if (!G.obedit) { if (!G.obedit) {
enter_editmode(); enter_editmode();

View File

@@ -567,6 +567,13 @@ void tbox_execute(void)
unsigned short event=0; unsigned short event=0;
unsigned short qual1=0, qual2=0; unsigned short qual1=0, qual2=0;
/* needed to check for valid selected objects */
Base *base;
Object *ob;
base= BASACT;
ob= base->object;
if(tbfunc) { if(tbfunc) {
tbfunc(tbval); tbfunc(tbval);
} }
@@ -590,6 +597,14 @@ void tbox_execute(void)
} }
/* ctrl-s (Shear): switch into editmode ### */ /* ctrl-s (Shear): switch into editmode ### */
else if(strcmp(tbstr1, "c|s")==0) { else if(strcmp(tbstr1, "c|s")==0) {
/* check that a valid object is selected to prevent crash */
if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) {
error("Only editable 3D objects can be sheared");
}
else if ((base->lay & G.vd->lay)==0) {
error("Only objects on visible layers can be warped");
}
else {
if (!G.obedit) { if (!G.obedit) {
enter_editmode(); enter_editmode();
/* ### put these into a deselectall_gen() */ /* ### put these into a deselectall_gen() */
@@ -602,7 +617,16 @@ void tbox_execute(void)
qual1 = LEFTCTRLKEY; qual1 = LEFTCTRLKEY;
event = SKEY; event = SKEY;
} }
}
else if(strcmp(tbstr1, "W")==0) { else if(strcmp(tbstr1, "W")==0) {
/* check that a valid object is selected to prevent crash */
if ((ob->type==OB_LAMP) || (ob->type==OB_EMPTY) || (ob->type==OB_FONT) || (ob->type==OB_CAMERA)) {
error("Only editable 3D objects can be warped");
}
else if ((base->lay & G.vd->lay)==0) {
error("Only objects on visible layers can be warped");
}
else {
if (!G.obedit) { if (!G.obedit) {
enter_editmode(); enter_editmode();
/* ### put these into a deselectall_gen() */ /* ### put these into a deselectall_gen() */
@@ -615,6 +639,7 @@ void tbox_execute(void)
qual1 = LEFTSHIFTKEY; qual1 = LEFTSHIFTKEY;
event = WKEY; event = WKEY;
} }
}
else if(strlen(tbstr1)<4 || (strlen(tbstr1)==4 && tbstr1[2]=='F')) { else if(strlen(tbstr1)<4 || (strlen(tbstr1)==4 && tbstr1[2]=='F')) {