Fixed bug #5742, Crash on sculpt mode. This bug was triggered when adding a new object while already in sculpt mode. Sculpt mode wasn't being deactived on cameras, lamps, etc. Fixed in add_object_draw() by turning off G_SCULPTMODE, also by adding a check in sculpt_init_session() to be sure any previous session is free'd before making a new one.
This commit is contained in:
@@ -186,7 +186,7 @@ void add_object_draw(int type) /* for toolbox or menus, only non-editmode stuff
|
||||
{
|
||||
Object *ob;
|
||||
|
||||
G.f &= ~(G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT);
|
||||
G.f &= ~(G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE);
|
||||
setcursor_space(SPACE_VIEW3D, CURSOR_STD);
|
||||
|
||||
if ELEM3(curarea->spacetype, SPACE_VIEW3D, SPACE_BUTS, SPACE_INFO) {
|
||||
|
||||
@@ -211,8 +211,11 @@ void sculptmode_init(Scene *sce)
|
||||
}
|
||||
|
||||
void sculptmode_undo_init();
|
||||
void sculptmode_free_session(Scene *);
|
||||
void sculpt_init_session()
|
||||
{
|
||||
if(sculpt_data()->session)
|
||||
sculptmode_free_session(G.scene);
|
||||
sculpt_data()->session= MEM_callocN(sizeof(SculptSession), "SculptSession");
|
||||
sculptmode_undo_init();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user