2
$\begingroup$

I tried to add a movie file using this script in the scripting window.

import bpy, os

os.system("chcp 65001")

dir_movie=r"O:\GK\Sozai\testdev\out.mp4"
bpy.ops.sequencer.movie_strip_add(dir_movie, channel=1, frame_start=1)

But this error message appeared on the console.

Traceback (most recent call last):
  File "O:\GK\dev\blender\test00.blend\Text", line 6, in <module>
  File "O:\files\blender-2.80.0-git.99d4321feff6-windows64\2.80\scripts\modules\bpy\ops.py", line 198, in __call__
    ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
TypeError: Calling operator "bpy.ops.sequencer.movie_strip_add" error, expected a string enum in ('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS', 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT', 'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA', 'EXEC_SCREEN')

sorry, I cannot understand this error message and how to fix this error. What I should do?

For your reference, my pc details are...

OS: Windows 10 Education(build: 17134.648)
Language: Japanese
CPU: Ryzen 1700X
GPU: GTX 1070
RAM: 16 GB
Blender: 2.8 or 2.79

Thanks.

$\endgroup$
2
  • $\begingroup$ Looks like you have set a number in which the channel (track) of your imported file on the editor, is going to land (chanel 0= track 1) $\endgroup$ Commented Mar 30, 2019 at 8:21
  • $\begingroup$ Referencing your comment, I changed this argumentto 0~10, and deleted this argument. But the same error message appeared. So, should I change other argument or add some setting? $\endgroup$ Commented Mar 30, 2019 at 8:49

1 Answer 1

1
$\begingroup$

sorry, I forgot to add a script and mistakenly specified this filepath. I can run the below script. Thanks.

import bpy, os
os.system("chcp 65001")

# I need this script.
bpy.context.area.type = 'SEQUENCE_EDITOR'

# and I need "filepath=".
bpy.ops.sequencer.movie_strip_add(filepath=r"O:\GK\Sozai\Sozaibitmap.mp4")
```
$\endgroup$
1
  • 2
    $\begingroup$ All operator properties are passed as keyword arguments, Is the codepage change necessary? $\endgroup$
    – batFINGER
    Commented Mar 30, 2019 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .