Page MenuHome

Python can't figure out Sequencer Strip element dimensions
Closed, DuplicatePublicTO DO

Description

There's no way to trigger the dimension calculation with python, seq.update(data=True) doesn't do anything. Same applies to scene updates, frame_set, tag_redraw etc.

import bpy
import os

fp = os.path.expanduser("~") + os.sep + "testimage.png"
img = bpy.data.images.new("Image", 200, 200)
img.save_render(fp)

scene = bpy.context.scene
editor = scene.sequence_editor_create()
seq = editor.sequences.new_image("SeqImage", fp, 0, 1)

seq.update(True)
w = seq.elements[0].orig_width
h = seq.elements[0].orig_height

print(seq.name, w, h)
# SeqImage 0 0

Event Timeline

codemanx created this task.Jun 17 2014, 4:42 AM
codemanx raised the priority of this task from to 90.
codemanx updated the task description. (Show Details)
codemanx edited a custom field.
codemanx added a subscriber: codemanx.

data=True flags the data to be reloaded when next used, but it wont trigger an update of the buffer.

Moved to TODO: http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Scripting#Python_RNA_access

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to Normal.Jun 17 2014, 9:48 AM
Campbell Barton (campbellbarton) edited a custom field.

"when next used" means when it's displayed in the sequencer preview? Or is there anything like the refresh_all operator that can trigger the update?

When the sequencer next requests an image buffer - render or preview.

as far as I can see theres no way to trigger an update besides rendering right now.