I try to load in an image sequence as background image with python. I managed to load it and set the source as sequence, however when i try to set its frame duration according to the number of images in the sequence, I get an error saying that the attribute is read-only. Can I change this attribute in another way and if not, how can I tell Blender to use it as image sequence?
My code so far:
path="C:\Users\user\Desktop\image0001.png"
img = bpy.data.images.load(path)
img.source = "SEQUENCE"
Prints an error:
img.frame_duration = 50
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: bpy_struct: attribute "frame_duration" from "Image" is read-
only