operator_mesh_uv.py 文件源码

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

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def main(context):
    obj = context.active_object
    me = obj.data
    bm = bmesh.from_edit_mesh(me)

    uv_layer = bm.loops.layers.uv.verify()
    bm.faces.layers.tex.verify()  # currently blender needs both layers.

    # adjust UVs
    for f in bm.faces:
        for l in f.loops:
            luv = l[uv_layer]
            if luv.select:
                # apply the location of the vertex as a UV
                luv.uv = l.vert.co.xy

    bmesh.update_edit_mesh(me)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号