diff options
Diffstat (limited to 'drafts/notes-blender.py')
-rwxr-xr-x | drafts/notes-blender.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drafts/notes-blender.py b/drafts/notes-blender.py new file mode 100755 index 0000000..4df76cf --- /dev/null +++ b/drafts/notes-blender.py @@ -0,0 +1,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) + |