bonext
bonext

Reputation: 147

Blender 2.5 Python video texture info

I load an animated texture in Blender 2.58 using python like this (see this question earlier):

#setup world
wtex = bpy.data.textures.new(name="WorldTexture", type='IMAGE')
# set World texture
wrld = bpy.context.scene.world
if wrld:
    slot = wrld.texture_slots.add()
    slot.texture = wtex
    slot.use_map_horizon = True
    img=bpy.data.images.load(filepath='\\vtex.avi')
    if img:
      slot.texture.image=img

How can I get the number of frames in the video (img)? Blender obviously does it when loading a texture from GUI, but I didn't find a way to make it from Python.

Upvotes: 0

Views: 648

Answers (1)

kivig
kivig

Reputation: 116

Use img.frame_duration; It gives the total number of frames in the video.

Upvotes: 0

Related Questions