Fix crash when file is saved in particle edit mode
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 6 Jun 2018 12:13:46 +0000 (14:13 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 6 Jun 2018 12:13:46 +0000 (14:13 +0200)
Depsgraph is not available on file load yet.

source/blender/editors/physics/particle_edit.c

index a5ca3cf853196f5c7ae7fd5c3d92f242c8ac80a4..fcf895fbd3c95b5562516a9ff76aae1a4e6e3332 100644 (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;