diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-04-09 12:45:51 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-04-09 12:45:51 +0400 |
commit | 48d71a40b10865cf6ec60e1f10dbbc2984b17bb9 (patch) | |
tree | 9e1633115ef56064ec5ec4bd6168f211d9c2d21a /source/blender/editors/space_sequencer | |
parent | d5953568c8b3ce1980c4cd872251042c72ac07e9 (diff) |
Fixes for MovieClip strip user counter.
Currently copies behavior of clip and image editors:
- On file load, all strip will reference clip they're using
- On adding new strip, clip would be referenced only if it've got zero user
- On removing strip clip wouldn't be de-referenced to prevent clip editors
pointing to zero-counted datablocks.
Not actually ideal from human beings point of view, but referencing/dereferencing
clip on each strip add/delete is getting crappy because of current logic of how
clip datablocks are referenced from clip editor (which is designed to work fine with
loading files without loading UI).
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index b611037061f..dfa733deac6 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -50,6 +50,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_sequencer.h" #include "BKE_movieclip.h" @@ -323,7 +324,10 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) seq->type = SEQ_MOVIECLIP; seq->blend_mode = SEQ_CROSS; seq->clip = clip; - + + if (seq->clip->id.us == 0) + seq->clip->id.us = 1; + /* basic defaults */ seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); seq->len = BKE_movieclip_get_duration(clip); |