Ante todo, No se asusten!!!, debajo de estas palabrejas extrañas hay un sencillo manual, elaborado para la Pyconf de Venezuela edición 2012.
PASO 1
¿Cómo instalar Blender?,
http://www.youtube.com/watch?v=J55VzJ_RX40
PASO 2
Arriba y a la izquierda
hay un menú desplegable,
Seleccionamos «Scripting»
PASO 3
Click en el botón más (+)
para añadir un nuevo texto
He aquí el código de construcción de una bandera de Venezuela con la api de Blender en python.
COPIA Y PEGA en el panel de texto.
#---------------------------------------------------------- # File Venezuela_flag.py #---------------------------------------------------------- import bpy def run(origin): # Creo cuatro materiales rojo = bpy.data.materials.new('Rojo') rojo.diffuse_color = (1,0,0) azul = bpy.data.materials.new('Azul') azul.diffuse_color = (0,0,0.6) amarillo = bpy.data.materials.new('Amarillo') amarillo.diffuse_color = (1,1,0) blanco = bpy.data.materials.new('Blanco') blanco.diffuse_color = (1,1,1) for toavaina in bpy.data.materials: toavaina.use_shadeless = True # Creo 3 planos y le asigno a cada uno su material #AMARILLO bpy.ops.mesh.primitive_plane_add(location=origin) objeto_amarillo = bpy.context.object amarillo_mat = objeto_amarillo.data amarillo_mat.materials.append(amarillo) objeto_amarillo.location=(0,0.8,0) objeto_amarillo.scale=(4.3,1,1) #AZUL bpy.ops.mesh.primitive_plane_add(location=origin) objeto_azul= bpy.context.object azul_mat = objeto_azul.data azul_mat.materials.append(azul) objeto_azul.location=(0,-1.2,0) objeto_azul.scale=(4.3,1,1) #ROJO bpy.ops.mesh.primitive_plane_add(location=origin) objeto_rojo = bpy.context.object rojo_mat = objeto_rojo.data rojo_mat.materials.append(rojo) objeto_rojo.location=(0,-3.2,0) objeto_rojo.scale=(4.3,1,1) # Creo las estrellas bpy.ops.mesh.primitive_circle_add(vertices=10, radius=0.23, location=(0,-3,0)) estrella = bpy.context.object bpy.ops.object.editmode_toggle() bpy.ops.transform.translate(value=(0,2.3,0.03)) bpy.ops.mesh.select_nth(nth=2, offset=0) bpy.ops.transform.resize(value=(0.44,0.44,0.44)) bpy.ops.mesh.select_all(action='SELECT') bpy.ops.mesh.fill() bpy.ops.mesh.flip_normals() bpy.ops.object.editmode_toggle() bpy.ops.transform.rotate(value=(-1.05,), axis=(0,0,-1)) blanco_mat = estrella.data blanco_mat.materials.append(blanco) num = 1 while num < 8: bpy.ops.object.duplicate_move() bpy.ops.transform.rotate(value=(0.3,), axis=(0,0,-1)) num +=1 if __name__ == "__main__": run((0,0,0))
PASO 4
A correr!!!!
¿Lo hiciste, que viste en el visor 3d?