This page is an archive of iMAL's wiki that operated between 2012 and 2022. It documented projects, residencies and workshops mostly taking place at iMAL's Fablab.

Older & newer Fablab projects are now found at fablab.imal.org

Blender python & sverchok

Scripts et projects blender vu au cours: Code, Arts & Crafts : Blender advanced

Lien vers l'API python

Code python pour générer une grille de 27 cubes:

import bpy
import math
import random
i = 0
for z in range( -1, 2 ):
    for y in range( -1, 2 ):
        for x in range( -1, 2 ):
            bpy.ops.mesh.primitive_cube_add()
            cube = bpy.context.active_object
            cube.name = "Yo"
            cube.location.x = x * 4
            cube.location.y = y * 4
            cube.location.z = z * 4
            if i % 2 == 0:
                cube.rotation_euler.z = math.pi / 4
            else:
                cube.rotation_euler.x = random.random() * math.pi
            #print( i, cube )
            i += 1

Gallery

Info

Difficulty: ●●●○○

Contributors:

Last updated: April 2017