My code runs fine when I run the script directly in blender. However if run the file headless in the terminal I get this error and the animation renders the default cube instead of my animation:
'NoneType' object has no attribute 'ui_type'
Here is my CLI command:
'/Applications/Blender.app/Contents/MacOS/Blender -b /Users/myname/Desktop/folder/videoRender.blend -a"
Blender text editor code:
import bpy, sys, os
bpy.context.area.ui_type = 'SEQUENCE_EDITOR'
#create image sequences and import screens of there are more than one file
if (len(files) == 1):
# set duration to 300
duration = 300
for index in range(5):
filesFolder = folder + "/" + str((index+1)) + '/renderedFiles/'
bpy.ops.sequencer.image_strip_add(
directory=filesFolder,
files=files[1],
show_multiview=False,
frame_start= (filesCount * index),
frame_end=filesCount * index,
channel=5
)
None
hence the error). $\endgroup$