0

I am adding a number of images to a video editor strip using image_strip_add according to this answer: https://blender.stackexchange.com/a/286951/75609

However, my images are not orientated correctly, some being rotated 90 or 180 degrees. I've tried different values for fit_method, but this seems to be ignored. I don't see any other relevant options in the API docs. Any idea as to what might be the reason?

I've also looked at the EXIF orientation data of the images but this doesn't seem to have any bearing on how they end up in the strip.

macduff
  • 101
  • 1

1 Answers1

0

One solution to your problem can be to orient the strips properly after adding them. As described in Documentation, object of SequenceTransform bpy_struct has rotation property. Regarding your question, there are several possible code samples you might be interested in:

Rotating active image strip:

bpy.context.active_sequence_strip.transform.rotation = 0.0

Rotating all images strips:

for seq in bpy.context.sequences:
    if seq.type == 'IMAGE':
       seq.transform.rotation = 0.0

Rotating only added image strips:

strips = []

for i in range(n): strip = bpy.ops.sequencer.image_strip_add(directory = 'imgs/') strips.append(strip)

for strip in strips: strip.transform.rotation = 0.0

Hope it helps!

BsdbX3D
  • 101
  • 4
  • Hi - I tried the last of these, but image_strip_add does not return an object with a transform property, but a set containing the word 'FINISHED' – macduff Mar 11 '23 at 20:41
  • I also tried the 2nd of these, but the transform rotation is already set to 0, so it makes no difference – macduff Mar 11 '23 at 20:53