diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-28 14:47:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-28 14:49:45 +0300 |
commit | 704b336899dd0a308f9160fa53478d2aaed9f730 (patch) | |
tree | 4097de7c0770eb7eb984ec9fb86f273ac423b006 /source/blender/makesrna/intern/rna_scene.c | |
parent | cb69a039e74b21ea2d5469b776719fbc9aea45ac (diff) |
Make scene statistics to respect locked interface
Interface is being locked when some destructive operations
are called from non-main thread.
This was causing crash with particles in T60065.
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 44e41fd60e1..e3e26a9a5bd 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -691,6 +691,11 @@ static void rna_Scene_volume_set(PointerRNA *ptr, float value) BKE_sound_set_scene_volume(scene, value); } +static const char *rna_Scene_statistics_string_get(Scene *scene, Main *bmain, ViewLayer *view_layer) +{ + return ED_info_stats_string(bmain, scene, view_layer); +} + static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { scene->r.framelen = (float)scene->r.framapto / (float)scene->r.images; @@ -6633,7 +6638,8 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL); /* Statistics */ - func = RNA_def_function(srna, "statistics", "ED_info_stats_string"); + func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get"); + RNA_def_function_flag(func, FUNC_USE_MAIN); parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "", "Active layer"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); parm = RNA_def_string(func, "statistics", NULL, 0, "Statistics", ""); |