# Randomizer - by Roland Hess 2005 # Made it for myself. Hope it's useful for you. # # No GUI here - simple as can be # Set your min and max rotations and scaling # in the appropriate variables below. # Select the objects you want to vary # and hit alt-p # # If you want no change in scaling, set max # and min to 1. # # If you want no change in rotation, set both # rotMin and rotMax to -1 import Blender from Blender import Object from Blender.Mathutils import * allSelected = Blender.Object.GetSelected() rotMin=0 rotMax=360 sizeXMin=.6 sizeXMax=1.2 sizeYMin=.6 sizeYMax=1.2 sizeZMin=.6 sizeZMax=1.8 for stem in allSelected: [rx,ry,rz]=stem.getEuler() [sx,sy,sz]=stem.getSize() rz=rz+Rand(rotMin,rotMax) if rz>360: rz-=360 sx=sx*Rand(sizeXMin,sizeXMax) sy=sy*Rand(sizeYMin,sizeYMax) sz=sz*Rand(sizeZMin,sizeZMax) if (rotMin!=-1 or rotMax!=-1): stem.setEuler(rx,ry,rz) stem.setSize(sx,sy,sz) Blender.Draw.Redraw()