【问题标题】:Blender 2.5 Python animated world texture setupBlender 2.5 Python 动画世界纹理设置
【发布时间】:2011-10-04 14:15:07
【问题描述】:

我需要使用 python 在搅拌机 2.58 中设置动画(即来自视频文件)世界纹理。 我制作了这样的纹理:

import bpy
# create new clouds texture
bpy.ops.texture.new()
wtex = bpy.data.textures[-1]
# set World texture
wrld = bpy.data.worlds['World']
slot = wrld.texture_slots.add()
slot.texture = wtex
slot.use_map_horizon = True

这会创建一个新的 CloudsTexture 并将其绑定到插槽。如何制作 ImageTexture 并将其设置为将视频作为来源?或者,如何指定由 bpy.ops.texture.new() 生成的新纹理的类型?

【问题讨论】:

    标签: python blender blender-2.50 bpython


    【解决方案1】:

    对于数据的添加/删除,最好不要使用操作符,我们有来自 bpy.data 的 api 函数。

    import bpy
    # create new clouds texture
    wtex = bpy.data.textures.new(name="MyTexture", 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
    

    用搅拌机 2.58a 测试

    【讨论】:

      猜你喜欢
      • 2011-03-18
      • 2011-10-05
      • 1970-01-01
      • 2018-07-08
      • 2015-02-21
      • 1970-01-01
      • 2012-04-26
      • 2012-04-03
      • 1970-01-01
      相关资源
      最近更新 更多