【问题标题】:Blender 2.5 Python video texture infoBlender 2.5 Python 视频纹理信息
【发布时间】:2011-10-05 08:37:13
【问题描述】:

我在 Blender 2.58 中使用 python 加载动画纹理(参见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

如何获取视频 (img) 中的帧数? Blender 在从 GUI 加载纹理时显然会这样做,但我没有找到从 Python 制作它的方法。

【问题讨论】:

  • 我意识到搅拌机安装在办公室的电脑上,所以我试了一下,但不幸的是什么也没找到。如果您将其作为纹理加载,则有一个 animFrames 属性,但在我测试的文件上它始终是 100 :(
  • 感谢您的关注,这可能会有所帮助。我明天去看看。

标签: python video textures blender blender-2.50


【解决方案1】:

使用img.frame_duration;它给出了视频中的总帧数。

【讨论】:

  • 你能再解释一下吗
  • "如何获取视频的帧数?" - img.frame_duration 给出视频中的总帧数。我误解了这个问题吗?
猜你喜欢
  • 2011-10-04
  • 1970-01-01
  • 1970-01-01
  • 2014-05-31
  • 1970-01-01
  • 2011-09-23
  • 2013-04-18
  • 1970-01-01
  • 2018-12-14
相关资源
最近更新 更多