Many buttons assumed G.vd existed. found all? buttons that cheashed Blender and made them test for G.vd
This commit is contained in:
@@ -313,6 +313,11 @@ void rad_collect_meshes()
|
||||
float *vd, *v1, *v2, *v3, *v4 = NULL;
|
||||
int a, b, offs, index;
|
||||
|
||||
if (G.vd==NULL) {
|
||||
printf("Error, trying to collect radiosity meshes with no 3d view\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if(G.obedit) {
|
||||
if (!during_script()) error("Unable to perform function in EditMode");
|
||||
return;
|
||||
|
||||
@@ -3860,6 +3860,11 @@ void RE_make_sticky(void)
|
||||
float ho[4], mat[4][4];
|
||||
int a;
|
||||
|
||||
if(G.vd==NULL) {
|
||||
printf("Need a 3d view to make sticky\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if(G.scene->camera==NULL) {
|
||||
printf("Need camera to make sticky\n");
|
||||
return;
|
||||
|
||||
@@ -632,6 +632,9 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
|
||||
|
||||
|
||||
default:
|
||||
if (G.vd==NULL)
|
||||
break;
|
||||
|
||||
if(event>=B_OBLAY && event<=B_OBLAY+31) {
|
||||
local= BASACT->lay & 0xFF000000;
|
||||
BASACT->lay -= local;
|
||||
|
||||
@@ -1924,6 +1924,9 @@ void do_effects_panels(unsigned short event)
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
break;
|
||||
case B_RECALCAL:
|
||||
if (G.vd==NULL)
|
||||
break;
|
||||
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
if(base->lay & G.vd->lay) {
|
||||
|
||||
@@ -1590,7 +1590,7 @@ void docentre(int centremode)
|
||||
int a, total= 0;
|
||||
MVert *mvert;
|
||||
|
||||
if(G.scene->id.lib) return;
|
||||
if(G.scene->id.lib || G.vd==NULL) return;
|
||||
|
||||
cent[0]= cent[1]= cent[2]= 0.0;
|
||||
|
||||
@@ -4820,7 +4820,7 @@ void auto_timeoffs(void)
|
||||
int tot=0, a;
|
||||
short offset=25;
|
||||
|
||||
if(BASACT==0) return;
|
||||
if(BASACT==0 || G.vd==NULL) return;
|
||||
if(button(&offset, 0, 1000,"Total time")==0) return;
|
||||
|
||||
/* make array of all bases, xco yco (screen) */
|
||||
|
||||
@@ -450,7 +450,7 @@ void fasterdraw(void)
|
||||
Mesh *me;
|
||||
int toggle, a;
|
||||
|
||||
if(G.obedit) return;
|
||||
if(G.obedit || G.vd==NULL) return;
|
||||
|
||||
/* reset flags */
|
||||
me= G.main->mesh.first;
|
||||
@@ -494,7 +494,7 @@ void slowerdraw(void) /* reset fasterdraw */
|
||||
Mesh *me;
|
||||
int a;
|
||||
|
||||
if(G.obedit) return;
|
||||
if(G.obedit || G.vd==NULL) return;
|
||||
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
|
||||
Reference in New Issue
Block a user