diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-27 13:10:01 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-27 13:10:01 +0300 |
commit | 067fe2719a993419ba64db2f4028d68139d64617 (patch) | |
tree | dc825ab63893b10666273a84a4995c993809de9b /source/blender/depsgraph | |
parent | 43dab7833ab06f5d2939023bee29e999b310310b (diff) |
Fix T45702: Editing smoke while viewport render and blender bug
Issue was caused by blender internal accessing data from DNA during rendering.
There's no simple solution to make stuff thread safe, so for now simply restart
rendering on frame update.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph.h | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index a772f4ee2e3..f37ba71ab65 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -205,10 +205,16 @@ typedef void (*DEG_EditorUpdateIDCb)(struct Main *bmain, struct ID *id); typedef void (*DEG_EditorUpdateSceneCb)(struct Main *bmain, struct Scene *scene, int updated); +typedef void (*DEG_EditorUpdateScenePreCb)(struct Main *bmain, + struct Scene *scene, + bool time); /* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, - DEG_EditorUpdateSceneCb scene_func); + DEG_EditorUpdateSceneCb scene_func, + DEG_EditorUpdateScenePreCb scene_pre_func); + +void DEG_editors_update_pre(struct Main *bmain, struct Scene *scene, bool time); #ifdef __cplusplus } /* extern "C" */ diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 2465654a723..a2c17b0fc8c 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -58,6 +58,7 @@ extern "C" { static DEG_EditorUpdateIDCb deg_editor_update_id_cb = NULL; static DEG_EditorUpdateSceneCb deg_editor_update_scene_cb = NULL; +static DEG_EditorUpdateScenePreCb deg_editor_update_scene_pre_cb = NULL; Depsgraph::Depsgraph() : root_node(NULL), @@ -467,10 +468,19 @@ void DEG_graph_free(Depsgraph *graph) /* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, - DEG_EditorUpdateSceneCb scene_func) + DEG_EditorUpdateSceneCb scene_func, + DEG_EditorUpdateScenePreCb scene_pre_func) { deg_editor_update_id_cb = id_func; deg_editor_update_scene_cb = scene_func; + deg_editor_update_scene_pre_cb = scene_pre_func; +} + +void DEG_editors_update_pre(Main *bmain, Scene *scene, bool time) +{ + if (deg_editor_update_scene_pre_cb != NULL) { + deg_editor_update_scene_pre_cb(bmain, scene, time); + } } void deg_editors_id_update(Main *bmain, ID *id) |