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