Skip to content

Instantly share code, notes, and snippets.

@enzyme69
Created March 24, 2013 01:55
Show Gist options
  • Save enzyme69/5230115 to your computer and use it in GitHub Desktop.
Save enzyme69/5230115 to your computer and use it in GitHub Desktop.
Blender Sushi Script to randomize the Scale Transform of user selected mesh. It randomize the Scale in 3 different axes separately.
import bpy
import random
# Define a function to randomize scale
def randomizeScale (minScale, maxScale):
selected_objects = bpy.context.selected_objects
for object in selected_objects:
randX = random.uniform (minScale, maxScale)
randY = random.uniform (minScale, maxScale)
randZ = random.uniform (minScale, maxScale)
object.scale = (randX, randY, randZ)
# Example how you would run the function and giving it required arguments
# which is the two value minScale and maxScale
randomizeScale(0.3, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment