11/30/2025 PYTHON

Alright this script with the help of ChatGPT kinda randomly moves verts up on a grid then extrudes the whole thing so it has some substance.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import bpy
import bmesh
import random

sets the drawing to object mode

bpy.ops.object.mode_set(mode=’OBJECT’)

selects all then deletes

bpy.ops.object.select_all(action=’SELECT’)
bpy.ops.object.delete()

creates a grid, sets EDIT mode

bpy.ops.mesh.primitive_grid_add(size=2, enter_editmode= True, align=’WORLD’, location=(0, 0, 0), scale=(1, 1, 1))

makes variables for the grid object, data, and mesh

grid_obj = bpy.context.object
grid_data = grid_obj.data
grid_mesh = bmesh.from_edit_mesh(grid_data)

ensure lookup table

grid_mesh.verts.ensure_lookup_table()

Assign a random int 0-3 to each vertex

for i, v in enumerate(grid_mesh.verts):
rand_int = random.randint(0,1)
v.co.z += rand_int

extrudes region and transforms it .5 z positive

bpy.ops.mesh.extrude_region()
bpy.ops.transform.translate(value=(0, 0, .5))