Blender 2.5 Python视频纹理信息
我在Blender 2.58中使用Python加载一个动画纹理,像这样(可以参考之前的问题):
#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
我想知道怎么才能获取视频(图片)中的帧数。显然,Blender在通过图形界面加载纹理时会自动处理这个,但我找不到用Python实现的方法。
1 个回答
0
使用 img.frame_duration
;它会告诉你视频中总共有多少帧。