July 11, 2012

randomize geometry

This snippet randomizes the z value of all vertices by a given amount. (be in object mode, with a mesh object selected)
import bpy
import random

verts = bpy.context.active_object.data.vertices

for i in verts:
    i.co.z *= random.uniform(0.7, 1.3) 
        
In combination with the separation script from a previous post you can get some neat effects, maybe this will plant some seeds