[Bf-blender-cvs] [20185a8681f] blender2.8: Cleanup "Sync Mode" (i.e. Av Sync/Framedropping) stuff

Joshua Leung noreply at git.blender.org
Thu May 3 18:50:57 CEST 2018


Commit: 20185a8681f15f3e4e129e064fbe9a150dc4c963
Author: Joshua Leung
Date:   Thu May 3 18:50:53 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB20185a8681f15f3e4e129e064fbe9a150dc4c963

Cleanup "Sync Mode" (i.e. Av Sync/Framedropping) stuff

* Remove the "sync_mode" dropdown from timeline header, and move it into
  the Playback menu instead.
* Remove the confusing "Frame Dropping" and "AV Sync" entries from the
  Playback menu. These were supposed to be mutually exclusive (or else,
  the "sync_mode" menu would break).
* Turn AV Sync on by default
* Commented out the Frame Dropping and Av Sync RNA Properties too.
  THere doesn't seem to be any valid reason for these to exist?

===================================================================

M	release/scripts/startup/bl_ui/space_time.py
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index a1f0f5a7cc8..6710ed634b9 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -77,8 +77,6 @@ class TIME_HT_editor_buttons(Header):
         row.operator("screen.keyframe_jump", text="", icon='NEXT_KEYFRAME').next = True
         row.operator("screen.frame_jump", text="", icon='FF').end = True
 
-        layout.prop(scene, "sync_mode", text="")
-
         layout.separator()
 
         row = layout.row(align=True)
@@ -218,10 +216,9 @@ class TIME_MT_playback(Menu):
         layout.prop(screen, "use_follow")
         layout.separator()
 
-        layout.prop(scene, "use_frame_drop", text="Frame Dropping")
-        layout.prop(scene, "use_audio_sync", text="AV-sync", icon='SPEAKER')
         layout.prop(scene, "use_audio")
         layout.prop(scene, "use_audio_scrub")
+        layout.prop_menu_enum(scene, "sync_mode")
 
 
 class TIME_MT_autokey(Menu):
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index f3f08aec3cd..a11c7320da5 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -717,6 +717,7 @@ void BKE_scene_init(Scene *sce)
 	sce->audio.doppler_factor = 1.0f;
 	sce->audio.speed_of_sound = 343.3f;
 	sce->audio.volume = 1.0f;
+	sce->audio.flag = AUDIO_SYNC;
 
 	BLI_strncpy(sce->r.pic, U.renderdir, sizeof(sce->r.pic));
 
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 1e27ab64f48..3211ed4fc11 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -210,6 +210,11 @@ void BLO_update_defaults_startup_blend(Main *bmain)
 		}
 
 		scene->r.ffcodecdata.audio_mixrate = 48000;
+		
+		/* set av sync by default */
+		printf("setting new default audio\n");
+		scene->audio.flag |= AUDIO_SYNC;
+		scene->flag &= ~SCE_FRAME_DROP;
 	}
 
 	for (FreestyleLineStyle *linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) {
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 1fb4e2d8b57..b93c3cf1dc6 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5864,14 +5864,17 @@ void RNA_def_scene(BlenderRNA *brna)
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
 	
 	/* Frame dropping flag for playback and sync enum */
+#if 0 /* XXX: Is this actually needed? */
 	prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP);
 	RNA_def_property_ui_text(prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
+#endif
 
 	prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", NULL);
 	RNA_def_property_enum_items(prop, sync_mode_items);
+	RNA_def_property_enum_default(prop, AUDIO_SYNC);
 	RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
@@ -6007,11 +6010,13 @@ void RNA_def_scene(BlenderRNA *brna)
 	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);
 
+#if 0 /* XXX: Is this actually needed? */
 	prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
 	RNA_def_property_ui_text(prop, "Audio Sync",
 	                         "Play back and sync with audio clock, dropping frames if frame display is too slow");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
+#endif
 
 	prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);



More information about the Bf-blender-cvs mailing list