Fixed a number of crashes occuring when loading saved files with sculpt mode active. (mostly missing checks for a sculpt session.)
This commit is contained in:
@@ -2745,8 +2745,8 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
persp(PERSP_WIN); // set ortho
|
||||
|
||||
/* Draw Sculpt Mode brush */
|
||||
if(!G.obedit && (G.f & G_SCULPTMODE) && area_is_active_area(v3d->area)) {
|
||||
PropsetData *pd= G.scene->sculptdata.session->propset;
|
||||
if(!G.obedit && (G.f & G_SCULPTMODE) && area_is_active_area(v3d->area) && sculpt_session()) {
|
||||
PropsetData *pd= sculpt_session()->propset;
|
||||
short r1=100, r2=100, r3=100;
|
||||
if(pd) {
|
||||
if(pd->mode == PropsetSize) {
|
||||
|
||||
@@ -1651,6 +1651,11 @@ void sculpt()
|
||||
|
||||
ob= OBACT;
|
||||
if(ob->id.lib) return;
|
||||
|
||||
if(!ss) {
|
||||
sculpt_init_session();
|
||||
ss= sd->session;
|
||||
}
|
||||
|
||||
/* Make sure that the active mesh is set correctly */
|
||||
if(get_mesh(OBACT) != get_mesh(ob))
|
||||
|
||||
@@ -1068,7 +1068,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
|
||||
if(!mouse_in_header(sa)) {
|
||||
if(!G.obedit && (G.f & G_SCULPTMODE)) {
|
||||
if(sculpt_session()->propset) {
|
||||
SculptSession *ss= sculpt_session();
|
||||
if(ss && ss->propset) {
|
||||
sculptmode_propset(event);
|
||||
return;
|
||||
}
|
||||
@@ -1210,7 +1211,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
}
|
||||
}
|
||||
else if(!G.obedit && (G.f & G_SCULPTMODE)) {
|
||||
SculptData *sd= &G.scene->sculptdata;
|
||||
SculptData *sd= sculpt_data();
|
||||
SculptSession *ss= sculpt_session();
|
||||
BrushData *br= sculptmode_brush();
|
||||
Mesh *me= get_mesh(OBACT);
|
||||
char update_prop= 0;
|
||||
@@ -1218,7 +1220,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
case LEFTMOUSE:
|
||||
if(G.qual==LR_SHIFTKEY+LR_CTRLKEY)
|
||||
sculptmode_pmv(0);
|
||||
else if(!sculpt_session()->propset)
|
||||
else if(!(ss && ss->propset))
|
||||
sculpt();
|
||||
break;
|
||||
/* View */
|
||||
|
||||
Reference in New Issue
Block a user