diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-06 13:46:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-06 13:54:16 +0300 |
commit | 064273a4ae7101f937cf2e16b0e2f1efcd2f0e38 (patch) | |
tree | b10ee52c452decf2cd3ba760794609ee6795043b /source/blender/makesrna/intern/rna_scene.c | |
parent | 2c0da4a3db96d4aeeeec1cfba4a0a9f5bf0fa970 (diff) |
Sound: Port more cases to be a part of dependency graph
Mainly covers RNA callbacks which were still doing direct scene update,
which was causing crashes. Now corresponding ID_RECALC flags are used,
so all scenes can update accordingly.
Also tested animated volume/pitch on strips, which now works as well.
Fixes T64133: Assert after changing FPS
Fixes T64154: Immediate crash when changing the current frame on the timeline
Fixes T64185: Client Crashes when the frame position value is changed
Fixes T64190: Blender Crash using Timeline Editor
Fixes T64128: Click to close bug type on timeline
Fixes T64147: Crash when setting current frame from Python
Fixes T64152: Blender Auto-Close on timeline change
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index f1452d001bc..42d44ee2e37 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -669,7 +669,6 @@ const EnumPropertyItem rna_enum_transform_orientation_items[] = { # include "BKE_pointcache.h" # include "BKE_scene.h" # include "BKE_mesh.h" -# include "BKE_sound.h" # include "BKE_screen.h" # include "BKE_sequencer.h" # include "BKE_animsys.h" @@ -815,22 +814,17 @@ static void rna_Scene_camera_update(Main *bmain, Scene *UNUSED(scene_unused), Po static void rna_Scene_fps_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { - BKE_sound_update_fps(scene); - BKE_sequencer_update_sound_bounds_all(scene); + DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_FPS | ID_RECALC_SEQUENCER_STRIPS); } static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { - BKE_sound_update_scene_listener(scene); + DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_LISTENER); } -static void rna_Scene_volume_set(PointerRNA *ptr, float value) +static void rna_Scene_volume_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { - Scene *scene = (Scene *)(ptr->data); - - scene->audio.volume = value; - if (scene->sound_scene) - BKE_sound_set_scene_volume(scene, value); + DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_VOLUME); } static const char *rna_Scene_statistics_string_get(Scene *scene, @@ -956,10 +950,12 @@ static void rna_Scene_show_subframe_update(Main *UNUSED(bmain), scene->r.subframe = 0.0f; } -static void rna_Scene_frame_update(Main *bmain, Scene *UNUSED(current_scene), PointerRNA *ptr) +static void rna_Scene_frame_update(Main *UNUSED(bmain), + Scene *UNUSED(current_scene), + PointerRNA *ptr) { Scene *scene = (Scene *)ptr->id.data; - BKE_sound_seek_scene(bmain, scene); + DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK); WM_main_add_notifier(NC_SCENE | ND_FRAME, scene); } @@ -1790,8 +1786,11 @@ static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value) scene->audio.flag |= AUDIO_MUTE; else scene->audio.flag &= ~AUDIO_MUTE; +} - BKE_sound_mute_scene(scene, value); +static void rna_Scene_use_audio_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +{ + DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_MUTE); } static int rna_Scene_sync_mode_get(PointerRNA *ptr) @@ -7519,7 +7518,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set"); RNA_def_property_ui_text( prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted"); - RNA_def_property_update(prop, NC_SCENE, NULL); + RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update"); # if 0 /* XXX: Is this actually needed? */ prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE); @@ -7566,7 +7565,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Volume", "Audio volume"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND); RNA_def_property_update(prop, NC_SCENE, NULL); - RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL); + RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update"); /* Statistics */ func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get"); |