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.
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_buffers.h"
|
||||
@@ -142,6 +143,23 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated)
|
||||
recursive_check = false;
|
||||
}
|
||||
|
||||
void ED_render_scene_update_pre(Main *bmain, Scene *scene, bool time)
|
||||
{
|
||||
/* Blender internal might access to the data which is gonna to be freed
|
||||
* by the scene update functions. This applies for example to simulation
|
||||
* data like smoke and fire.
|
||||
*/
|
||||
if (time && !BKE_scene_use_new_shading_nodes(scene)) {
|
||||
bScreen *sc;
|
||||
ScrArea *sa;
|
||||
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
|
||||
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
||||
ED_render_engine_area_exit(bmain, sa);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ED_render_engine_area_exit(Main *bmain, ScrArea *sa)
|
||||
{
|
||||
/* clear all render engines in this area */
|
||||
|
||||
Reference in New Issue
Block a user