Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # tested on Blender 2.78
- import bpy
- numSteps = 20
- stpWid = 1
- stpLen = 4
- stp1Hgt = 1
- stpIncr = 0.1
- # clean the slate (delete all objects in scene)
- bpy.ops.object.select_all(action='SELECT') # select everything
- bpy.ops.object.delete(use_global=False) # delete selected
- def makeCuboid(dim,loc):
- bpy.ops.mesh.primitive_cube_add(radius=0.5, location=loc )
- bpy.ops.transform.resize(value=dim, constraint_axis=(True, True, True))
- xLoc,yLoc,zLoc = stpWid/2,stpLen/2,stp1Hgt/2
- CurrStpHgt = stp1Hgt
- for i in range(numSteps):
- makeCuboid([stpWid,stpLen,CurrStpHgt],[ xLoc,yLoc,zLoc ] )
- CurrStpHgt = CurrStpHgt + stpIncr
- xLoc,yLoc,zLoc = xLoc+stpWid,yLoc,zLoc+CurrStpHgt-stpIncr/2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement