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();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWBUTSHEAD, 0);
allqueue(REDRAWBUTSCONSTRAINT, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWALL, 0);
}
static void add_bone_input (Object *ob)

View File

@@ -3796,10 +3796,8 @@ void add_primitiveCurve(int stype)
BLI_addtail(&editNurb, nu);
makeDispList(G.obedit);
allqueue(REDRAWBUTSALL, 0);
countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWALL, 0);
}
void add_primitiveNurb(int type)
@@ -3828,11 +3826,9 @@ void add_primitiveNurb(int type)
nu= addNurbprim(4, type, newname);
BLI_addtail(&editNurb,nu);
makeDispList(G.obedit);
allqueue(REDRAWBUTSALL, 0);
countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWALL, 0);
}

View File

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

View File

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

View File

@@ -4535,11 +4535,9 @@ void add_primitiveMesh(int type)
if(type!=0 && type!=10) righthandfaces(1);
countall();
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */
allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWALL, 0);
makeDispList(G.obedit);
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);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWACTION,0);
allqueue(REDRAWHEADERS, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWALL, 0);
deselect_all_area_oops();
set_select_flag_oops();
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)) {
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 {
if (!G.obedit) {
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)) {
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) {
enter_editmode();

View File

@@ -567,6 +567,13 @@ void tbox_execute(void)
unsigned short event=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) {
tbfunc(tbval);
}
@@ -590,30 +597,48 @@ void tbox_execute(void)
}
/* ctrl-s (Shear): switch into editmode ### */
else if(strcmp(tbstr1, "c|s")==0) {
if (!G.obedit) {
enter_editmode();
/* ### put these into a deselectall_gen() */
if(G.obedit->type==OB_MESH) deselectall_mesh();
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) deselectall_nurb();
else if(G.obedit->type==OB_MBALL) deselectall_mball();
else if(G.obedit->type==OB_LATTICE) deselectall_Latt();
/* ### */
/* 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) {
enter_editmode();
/* ### put these into a deselectall_gen() */
if(G.obedit->type==OB_MESH) deselectall_mesh();
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) deselectall_nurb();
else if(G.obedit->type==OB_MBALL) deselectall_mball();
else if(G.obedit->type==OB_LATTICE) deselectall_Latt();
/* ### */
}
qual1 = LEFTCTRLKEY;
event = SKEY;
}
qual1 = LEFTCTRLKEY;
event = SKEY;
}
else if(strcmp(tbstr1, "W")==0) {
if (!G.obedit) {
enter_editmode();
/* ### put these into a deselectall_gen() */
if(G.obedit->type==OB_MESH) deselectall_mesh();
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) deselectall_nurb();
else if(G.obedit->type==OB_MBALL) deselectall_mball();
else if(G.obedit->type==OB_LATTICE) deselectall_Latt();
/* ### */
/* 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) {
enter_editmode();
/* ### put these into a deselectall_gen() */
if(G.obedit->type==OB_MESH) deselectall_mesh();
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) deselectall_nurb();
else if(G.obedit->type==OB_MBALL) deselectall_mball();
else if(G.obedit->type==OB_LATTICE) deselectall_Latt();
/* ### */
}
qual1 = LEFTSHIFTKEY;
event = WKEY;
}
qual1 = LEFTSHIFTKEY;
event = WKEY;
}
else if(strlen(tbstr1)<4 || (strlen(tbstr1)==4 && tbstr1[2]=='F')) {