Fix crash when file is saved in particle edit mode

Depsgraph is not available on file load yet.
This commit is contained in:
Sergey Sharybin 2018-06-06 14:13:46 +02:00
parent 2088bb0d49
commit a8ae68aa5c
1 changed files with 2 additions and 1 deletions

View File

@ -61,6 +61,7 @@
#include "BKE_modifier.h"
#include "BKE_particle.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_bvhutils.h"
#include "BKE_pointcache.h"
@ -4511,7 +4512,7 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *op)
* rewriting the while edit mode code.
*/
ob->id.recalc |= (ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
DEG_evaluate_on_refresh(depsgraph);
BKE_scene_graph_update_tagged(depsgraph, CTX_data_main(C));
BKE_object_eval_transform_all(depsgraph, scene, ob);
BKE_object_handle_data_update(depsgraph, scene, ob);
ob->mode |= mode_flag;