Fix T56331: Undo crash w/ sculpt on hidden layer
This commit is contained in:
@@ -150,7 +150,8 @@ void ED_object_mode_set(bContext *C, eObjectMode mode)
|
|||||||
WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &ptr);
|
WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &ptr);
|
||||||
WM_operator_properties_free(&ptr);
|
WM_operator_properties_free(&ptr);
|
||||||
#else
|
#else
|
||||||
Object *ob = CTX_data_active_object(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
Object *ob = OBACT;
|
||||||
if (ob == NULL) {
|
if (ob == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -5789,7 +5789,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
|||||||
{
|
{
|
||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Object *ob = CTX_data_active_object(C);
|
Object *ob = OBACT;
|
||||||
const int mode_flag = OB_MODE_SCULPT;
|
const int mode_flag = OB_MODE_SCULPT;
|
||||||
const bool is_mode_set = (ob->mode & mode_flag) != 0;
|
const bool is_mode_set = (ob->mode & mode_flag) != 0;
|
||||||
|
|
||||||
|
@@ -138,8 +138,8 @@ static bool sculpt_undo_restore_deformed(
|
|||||||
static bool sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNode *unode)
|
static bool sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNode *unode)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
Object *ob = OBACT;
|
||||||
Object *ob = CTX_data_active_object(C);
|
Sculpt *sd = scene->toolsettings->sculpt;
|
||||||
SculptSession *ss = ob->sculpt;
|
SculptSession *ss = ob->sculpt;
|
||||||
MVert *mvert;
|
MVert *mvert;
|
||||||
int *index;
|
int *index;
|
||||||
@@ -254,7 +254,8 @@ static bool sculpt_undo_restore_hidden(
|
|||||||
bContext *C, DerivedMesh *dm,
|
bContext *C, DerivedMesh *dm,
|
||||||
SculptUndoNode *unode)
|
SculptUndoNode *unode)
|
||||||
{
|
{
|
||||||
Object *ob = CTX_data_active_object(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
Object *ob = OBACT;
|
||||||
SculptSession *ss = ob->sculpt;
|
SculptSession *ss = ob->sculpt;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -286,7 +287,8 @@ static bool sculpt_undo_restore_hidden(
|
|||||||
|
|
||||||
static bool sculpt_undo_restore_mask(bContext *C, DerivedMesh *dm, SculptUndoNode *unode)
|
static bool sculpt_undo_restore_mask(bContext *C, DerivedMesh *dm, SculptUndoNode *unode)
|
||||||
{
|
{
|
||||||
Object *ob = CTX_data_active_object(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
Object *ob = OBACT;
|
||||||
SculptSession *ss = ob->sculpt;
|
SculptSession *ss = ob->sculpt;
|
||||||
MVert *mvert;
|
MVert *mvert;
|
||||||
float *vmask;
|
float *vmask;
|
||||||
@@ -471,7 +473,7 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb)
|
|||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||||
Object *ob = CTX_data_active_object(C);
|
Object *ob = OBACT;
|
||||||
DerivedMesh *dm;
|
DerivedMesh *dm;
|
||||||
SculptSession *ss = ob->sculpt;
|
SculptSession *ss = ob->sculpt;
|
||||||
SculptUndoNode *unode;
|
SculptUndoNode *unode;
|
||||||
@@ -637,7 +639,8 @@ static void sculpt_undo_free_list(ListBase *lb)
|
|||||||
#if 0
|
#if 0
|
||||||
static bool sculpt_undo_cleanup(bContext *C, ListBase *lb)
|
static bool sculpt_undo_cleanup(bContext *C, ListBase *lb)
|
||||||
{
|
{
|
||||||
Object *ob = CTX_data_active_object(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
Object *ob = OBACT;
|
||||||
SculptUndoNode *unode;
|
SculptUndoNode *unode;
|
||||||
|
|
||||||
unode = lb->first;
|
unode = lb->first;
|
||||||
@@ -1015,7 +1018,8 @@ static bool sculpt_undosys_poll(bContext *C)
|
|||||||
{
|
{
|
||||||
ScrArea *sa = CTX_wm_area(C);
|
ScrArea *sa = CTX_wm_area(C);
|
||||||
if (sa && (sa->spacetype == SPACE_VIEW3D)) {
|
if (sa && (sa->spacetype == SPACE_VIEW3D)) {
|
||||||
Object *obact = CTX_data_active_object(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
Object *obact = OBACT;
|
||||||
if (obact && (obact->mode & OB_MODE_SCULPT)) {
|
if (obact && (obact->mode & OB_MODE_SCULPT)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user