blender 刪除模型指定面 通過python

import bpy
import bmesh

#切換到編輯模式下

bpy.ops.object.mode_set(mode   = 'EDIT')
bpy.ops.mesh.select_mode(type= 'FACE')
#bpy.ops.mesh.select_all( action = 'SELECT' )


#bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value":(0,0,5)} )

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
faces = bm.faces

face = faces[0]
face.select = True
print(face )
bpy.ops.mesh.delete(type='ONLY_FACE')

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章