blob: 4df76cf58a43bfbb95781640ac668bf933ea1278 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import bpy
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_by_type(type='MESH')
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.remove_doubles()
bpy.ops.mesh.vert_connect_nonplanar()
bpy.ops.mesh.vert_connect_concave()
bpy.ops.object.editmode_toggle()
# https://github.com/kmammou/v-hacd
print_entity_start(worldspawn_props)
o = bpy.data.scenes['Scene'].objects['Suzanne']
# o.location = 1, 2, 3
# bpy.context.scene.update()
mw = o.matrix_world
me = o.data
me.update(calc_tessface=True)
#print("Mesh: %s, tessfaces: %d, vertices: %d"%(o.name,len(me.tessfaces),len(me.vertices)))
print_brush_start()
for fa in me.tessfaces:
print(" Face %d"%fa.index)
print(" Normal\t(local): ", fa.normal)
|