Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/ed_util.c
| Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | if (base != NULL) { | ||||
| BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); | BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void ED_editors_init(bContext *C) | void ED_editors_init(bContext *C) | ||||
| { | { | ||||
| struct Depsgraph *depsgraph = CTX_data_depsgraph(C); | struct Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C); | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| /* This is called during initialization, so we don't want to store any reports */ | /* This is called during initialization, so we don't want to store any reports */ | ||||
| ReportList *reports = CTX_wm_reports(C); | ReportList *reports = CTX_wm_reports(C); | ||||
| int reports_flag_prev = reports->flag & ~RPT_STORE; | int reports_flag_prev = reports->flag & ~RPT_STORE; | ||||
| Show All 32 Lines | if (obact && (ob->type == obact->type) && !ID_IS_LINKED(ob) && | ||||
| if (mode == OB_MODE_EDIT) { | if (mode == OB_MODE_EDIT) { | ||||
| ED_object_editmode_enter_ex(bmain, scene, ob, 0); | ED_object_editmode_enter_ex(bmain, scene, ob, 0); | ||||
| } | } | ||||
| else if (mode == OB_MODE_POSE) { | else if (mode == OB_MODE_POSE) { | ||||
| ED_object_posemode_enter_ex(bmain, ob); | ED_object_posemode_enter_ex(bmain, ob); | ||||
| } | } | ||||
| else if (mode & OB_MODE_ALL_SCULPT) { | else if (mode & OB_MODE_ALL_SCULPT) { | ||||
| if (obact == ob) { | if (obact == ob) { | ||||
| if (mode == OB_MODE_SCULPT) { | if (mode == OB_MODE_SCULPT) { | ||||
brecht: This is going to lead to dependency re-evaluation multiple times on file load in some cases, as… | |||||
| ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, true, reports); | ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, true, reports); | ||||
| } | } | ||||
| else if (mode == OB_MODE_VERTEX_PAINT) { | else if (mode == OB_MODE_VERTEX_PAINT) { | ||||
| ED_object_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob); | ED_object_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob); | ||||
| } | } | ||||
| else if (mode == OB_MODE_WEIGHT_PAINT) { | else if (mode == OB_MODE_WEIGHT_PAINT) { | ||||
| ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob); | ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines | |||||
This is going to lead to dependency re-evaluation multiple times on file load in some cases, as it loops through the objects and edits them.
We calll wm_event_do_depsgraph before ED_editors_init. I think we should put expect_evaluated at the start of this function, outside the object loop.