Advertisement
Guest User

Untitled

a guest
Jan 18th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. import bpy
  2.  
  3. rows = 5
  4. columns = 5
  5.  
  6. r = 0
  7. c = 0
  8.  
  9. for i in range(0, rows*columns):
  10. if c == columns:
  11. r += 1
  12. c = 0
  13.  
  14. bpy.ops.mesh.primitive_cube_add(location = (r, c, 0))
  15. bpy.context.scene.cursor_location = bpy.context.active_object.location
  16. bpy.context.scene.cursor_location.z -= 1
  17. bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
  18.  
  19. bpy.context.active_object.scale.x = 0.5
  20. bpy.context.active_object.scale.y = 0.5
  21. bpy.context.active_object.scale.z = 7
  22.  
  23. bpy.ops.anim.keyframe_insert_menu(type='Scaling')
  24. bpy.context.active_object.animation_data.action.fcurves[0]. lock = true
  25. bpy.context.active_object.animation_data.action.fcurves[1]. lock = true
  26.  
  27. bpy.context.area.type = 'GRAPH_EDITOR'
  28.  
  29. step = 8000/ (rows*columns)
  30.  
  31. bpy.ops.graph.sound_bake(filepath="/home/matthew/Music/Krewella - Come And Get It (Razihel Remix)", low=i*step, high=i*step + step)
  32.  
  33. bpy.context.active_object.animation_data.action.fcurves[2]. lock = true
  34.  
  35. c += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement