8

Does anyone know if there's a modifier or any other way to "randomize" the location of a number of objects? What I have is about 20 objects positioned next to each other and I want to randomize their Z value, but it's for a still, not for animation. I'd like to know if I can do this other than manually because I may have a lot more objects than just 20...

Thanks!!

EDIT: I've found a way. With all objects selected, I just need to run this script:

import bpy
from random import *

for ob in bpy.context.selected_objects:
  ob.location.z = ob.location.z + random() * 2

I wonder, however, is there's a more "visual" solution to this, other than scripting...

prubini87
  • 602
  • 3
  • 10
  • 19

1 Answers1

19

You can use the Randomize Transform operator with all objects selected in Object mode.

Press the Spacebar (or F3 with default 2.8 keymap)and then begin typing Randomize until the option appears, and adjust the desired axis for location/ rotation/ scale in the operator panel, or by pressing F6.

You can also access the operator from the menus via Object>Transform>Randomize transform to do the same thing.

enter image description here

Timaroberts
  • 12,395
  • 6
  • 39
  • 73
  • 1
    Thank you SO much!! I was disappointed Blender would not have this feature but I'm very happy it does. Yay! Hehehe... Thanks for your answer, superb. – prubini87 Mar 17 '17 at 00:39
  • For anyone using 2.8, space is now F3, so search with F3, and the randomize transform appears now in the object > transform.. menu. – lesolorzanov May 15 '20 at 10:09
  • How can we do this programmatically, such that the objects always remain in the cameras view frustum? – pookie Dec 05 '22 at 17:22