Ever wanted to rotate several layers at once? Today I figured out how to randomize a handful of layer rotations using the Python Console in the GIMP.
import random
import math
# Only one image was open, so I just grabbed the first image from the list
image = gimp.image_list()[0]
# I only wanted to affect layers with "Layer" in the title, but you can use any list here
layers = [x for x in image.layers if "Layer" in x.name]
# Loop over all the layers
for layer in layers:
ang = random.random() * 2 * math.pi
pdb.gimp_item_transform_rotate(layer, ang, True, 0, 0)