textureSampler.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:mayakit 作者: danbradham 项目源码 文件源码
def texture_sampler(texture, uvs_list=None):
    '''
    Create a textureSampler node

    :param texture_node: Path to texture node like "ramp1"
    :param uvs_list: List of uvs like [(0.0, 0.5), (0.5, 1.0)]
    '''

    texture_attr = texture + '.outColor'
    if not cmds.objExists(texture_attr):
        raise Exception('texture must have an outColor attribute')

    texture_node = cmds.shadingNode('textureSampler', asUtility=True)
    sampler = TextureSampler(texture_node)
    sampler.inColor = texture_attr
    uvs_list = uvs_list or [(0.5, 0.5)]
    sampler.set_uvs(uvs_list)

    return sampler
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号