Python can't figure out Sequencer Strip element dimensions #40663

Closed
opened 2014-06-17 04:42:10 +02:00 by CodeManX · 7 comments
Member

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
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
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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

`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
Author
Member

"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 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.

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.

Closed as duplicate of blender/blender#54395

Closed as duplicate of blender/blender#54395
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#40663
No description provided.