From 52cfc620c8cc3125282d8dd66df312ffb576569c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 11 Feb 2021 12:34:41 +1100 Subject: Fix T83013: Annotation with hidden object in sculpt mode crashes This just avoids the crash, the annotation tool still doesn't work. Larger changes will be needed to resolve this, see T85532. --- source/blender/editors/sculpt_paint/sculpt_transform.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.c b/source/blender/editors/sculpt_paint/sculpt_transform.c index da8204fd57c..4554ea178ab 100644 --- a/source/blender/editors/sculpt_paint/sculpt_transform.c +++ b/source/blender/editors/sculpt_paint/sculpt_transform.c @@ -60,10 +60,9 @@ #include #include -void ED_sculpt_init_transform(struct bContext *C) +void ED_sculpt_init_transform(struct bContext *C, Object *ob) { Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -220,10 +219,9 @@ static void sculpt_transform_all_vertices(Sculpt *sd, Object *ob) 0, ss->filter_cache->totnode, &data, sculpt_transform_task_cb, &settings); } -void ED_sculpt_update_modal_transform(struct bContext *C) +void ED_sculpt_update_modal_transform(struct bContext *C, Object *ob) { Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -243,9 +241,8 @@ void ED_sculpt_update_modal_transform(struct bContext *C) SCULPT_flush_update_step(C, SCULPT_UPDATE_COORDS); } -void ED_sculpt_end_transform(struct bContext *C) +void ED_sculpt_end_transform(struct bContext *C, Object *ob) { - Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; if (ss->filter_cache) { SCULPT_filter_cache_free(ss); -- cgit v1.2.3