Mini script to extrude faces with different values

I rote a mini script to extrude faces in edit mode with a different values can be set by variables

I made this shape with array modifier

import bpy  
import bmesh
from math import degrees, radians, sin, cos, tan

obj = bpy.context.edit_object
me = obj.data

bm = bmesh.from_edit_mesh(me)
lm = list (bm.faces) 
l = len(lm)
print(l)
for f in bm.faces :
    e = f.index
   
    bm.faces.ensure_lookup_table()
    bpy.ops.mesh.select_all(action='DESELECT')
    bm.faces[e].select=True
    
    ar = bpy.context.active_object.data.polygons[e].area
    print (ar)
    bpy.ops.mesh.extrude_region_shrink_fatten(MESH_OT_extrude_region={"use_normal_flip":False, "mirror":False}, TRANSFORM_OT_shrink_fatten={"value": -0.1*e*ar })

6 Likes

Simple and efficient.

1 Like

you know, if you animated them, moving vertically, it could look like a future AI <3

1 Like

maybe need to prevent extrude by 0

1 Like