Sequencer: Tweak to how/when the "use_framerate" option is enabled

In response to feedback from plasmasolutions that having this option "always on"
caused some examples of more destructive errors, this commit introduces an attempt
at seeking a better balance between doing what people expect when casually importing
clips, and not clobbering existing timelines.

Specifically:
1) When there's nothing in the scene, the option will default to being enabled.
   This accounts for users doing this for the first time with no strips
2) When there are already sequence strips, the option will default to being disabled.
   In this case, changing the framerate could be dangerous. Hopefully this new check
   is sufficient.
3) There's always still the option for users to control what exactly happens. However,
   there have been reports that this cannot always be seen/set?
This commit is contained in:
Joshua Leung 2016-01-09 00:12:33 +13:00
parent 4ef918d661
commit 875be10903
1 changed files with 14 additions and 0 deletions

View File

@ -638,6 +638,20 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, const w
{
PropertyRNA *prop;
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, false);
/* only enable "use_framerate" if there aren't any existing strips
* - When there are no strips yet, there is no harm in enabling this,
* and it makes the single-strip case really nice for casual users
* - When there are strips, it's best we don't touch the framerate,
* as all hell may break loose (e.g. audio strips start overlapping
* and can't be restored)
* - These initial guesses can still be manually overridden by users
* from the modal options panel
*/
if (ed && ed->seqbasep && ed->seqbasep->first) {
RNA_boolean_set(op->ptr, "use_framerate", false);
}
/* This is for drag and drop */
if ((RNA_struct_property_is_set(op->ptr, "files") && RNA_collection_length(op->ptr, "files")) ||