materialhelper.py 文件源码

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

项目:blemd 作者: niacdoial 项目源码 文件源码
def add_vcolor(mesh, representation, layerID):
    """copies vertex colors (layer `layerID`) from the representation to the blender mesh"""

    vx_layer = mesh.vertex_colors.new("v_color_"+str(layerID))
    vx_layer_a = mesh.vertex_colors.new("v_color_alpha_"+str(layerID))
    # alpimg = bpy.data.images.new(mesh.name+'_vcol_alpha_'+str(layerID), 256, 256)
    # XCX image method buggy -> disabled

    for num, com in enumerate(representation.loops):
        vx_layer.data[num].color = mathutils.Color(com.VColors[layerID][:3])
        vx_layer_a.data[num].color = mathutils.Color(tuple(com.VColors[layerID][3])*3)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号