3dm_snow.py 文件源码

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

项目:Blender-Add-ons-3DM-Snow 作者: 3DMish 项目源码 文件源码
def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifiers=False):
    assert(obj.type == 'MESH')

    if apply_modifiers and obj.modifiers:
        import bpy
        me = obj.to_mesh(bpy.context.scene, True, 'PREVIEW', calc_tessface=False)
        bm = bmesh.new(); bm.from_mesh(me); bpy.data.meshes.remove(me)
        del bpy
    else:
        me = obj.data
        if obj.mode == 'EDIT': bm_orig = bmesh.from_edit_mesh(me); bm = bm_orig.copy()
        else: bm = bmesh.new(); bm.from_mesh(me)

    if transform: bm.transform(obj.matrix_world)
    if triangulate: bmesh.ops.triangulate(bm, faces=bm.faces)
    return bm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号