Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-12-03 09:42:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-03 09:42:26 +0300
commitf32dfd0819fe871a3ec2efdac573c060537e7150 (patch)
tree480219662dea55ceda55bddc315183a387659f15 /source/blender/editors/sculpt_paint/sculpt_undo.c
parent335e1b507b1ad0e7c2bafb2175dac15d3d1add83 (diff)
Fix T56331: Undo crash w/ sculpt on hidden layer
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 62e548f661c..aab3e009a9d 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -138,8 +138,8 @@ static bool sculpt_undo_restore_deformed(
static bool sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNode *unode)
{
Scene *scene = CTX_data_scene(C);
- Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- Object *ob = CTX_data_active_object(C);
+ Object *ob = OBACT;
+ Sculpt *sd = scene->toolsettings->sculpt;
SculptSession *ss = ob->sculpt;
MVert *mvert;
int *index;
@@ -254,7 +254,8 @@ static bool sculpt_undo_restore_hidden(
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;
int i;
@@ -286,7 +287,8 @@ static bool sculpt_undo_restore_hidden(
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;
MVert *mvert;
float *vmask;
@@ -471,7 +473,7 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb)
{
Scene *scene = CTX_data_scene(C);
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- Object *ob = CTX_data_active_object(C);
+ Object *ob = OBACT;
DerivedMesh *dm;
SculptSession *ss = ob->sculpt;
SculptUndoNode *unode;
@@ -637,7 +639,8 @@ static void sculpt_undo_free_list(ListBase *lb)
#if 0
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;
unode = lb->first;
@@ -1015,7 +1018,8 @@ static bool sculpt_undosys_poll(bContext *C)
{
ScrArea *sa = CTX_wm_area(C);
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)) {
return true;
}