Blender Git Commit Log

Git Commits -> Revision b9f5658

Revision b9f5658 by Sybren A. Stüvel (master)
July 13, 2020, 13:09 (GMT)
VSE: Python API, allow creation of VSE Movie strips with missing file

It was already possible to create Sound and Image strips that reference
non-existing files. Now it's also possible to create Movie strips
referencing missing files via the Python API call
`Sequences.new_movie()`. In this case, the duration of the strip will be
set to 1 frame.

Note that this commit does not change anything in the user interface.

The Python API of the `MovieStrip` class is extended with a function
`reload_if_needed()`. This function only performs disk I/O if the movie
strip cannot produce frames, that is either when its filepath points to
a non-existing file, or when the video sequence editor has not been
shown yet (for example because it is in an inactive workspace).

This allows for the following:

```
import bpy

scene = bpy.context.scene
vse = scene.sequence_editor_create()

filepath = bpy.path.abspath('//demo.mkv')
strip = vse.sequences.new_movie("movie", filepath,
channel=2,
frame_start=47,
file_must_exist=False)
strip.frame_final_end = 327
```

This will create a new movie strip, even when `demo.mkv` does not exist.

Once `demo.mkv` has appeared at the expected location, either
`strip.reload_if_needed()` or `strip.filepath = strip.filepath` will
load it.

Differential Revision: https://developer.blender.org/D8257

Reviewed By: Sergey, ISS

Commit Details:

Full Hash: b9f565881e15f13f5f30b6aca9fc656b3f92b900
Parent Commit: 9db0c36
Lines Changed: +119, -19

6 Modified Paths:

/source/blender/blenkernel/BKE_sequencer.h (+5, -0) (Diff)
/source/blender/blenkernel/intern/sequencer.c (+58, -0) (Diff)
/source/blender/imbuf/IMB_imbuf.h (+1, -0) (Diff)
/source/blender/imbuf/intern/anim_movie.c (+15, -0) (Diff)
/source/blender/makesrna/intern/rna_sequencer.c (+26, -0) (Diff)
/source/blender/makesrna/intern/rna_sequencer_api.c (+14, -19) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021