Código: Seleccionar todo
#----------------------------------------------------------
# File meshes.py
#----------------------------------------------------------
import bpy
def createMesh(name, origin, verts, edges, faces):
# Create mesh and object
me = bpy.data.meshes.new(name+\'Mesh\')
ob = bpy.data.objects.new(name, me)
ob.location = origin
ob.show_name = True
# Link object to scene
bpy.context.scene.objects.link(ob)
# Create mesh from given verts, edges, faces. Either edges or
# faces should be [], or you ask for problems
me.from_pydata(verts, edges, faces)
# Update mesh with new data
me.update(calc_edges=True)
return ob
def run(origin):
(x,y,z) = (0.707107, 0.258819, 0.965926)
verts1 = ((1, 1, 1),(0, 1, 1),(0, 0, 1),(1, 0, 1),(1, 1, 0),(0, 1, 0),(0, 0, 0),(1, 0, 0))
faces1 = ((0,1,2,3),(4,5,6,7),(0,1,5,4),(1,2,6,5),(2,3,7,6),(3,0,4,7))
ob1 = createMesh(\'Solid\', origin, verts1, [], faces1)
#apply bevel
ob1.modifiers.new(name=\"algo\",type=\"BEVEL\") # [color=#006633]no me funciona no se porque[/color]
ob1.select = True
bpy.ops.transform.translate(value=(0,2,0))
return
if __name__ == \"__main__\":
run((0,0,0))