circle of trees
import bpy, math from random import uniform, random ## prepare scene to use grease pencil ## ## By default blender does not start with grease pencil ready for using . ## The following is just a hack. So you can mostly ignore it. # Create grease pencil data if none exists if not bpy.context.scene.grease_pencil: a = [ a for a in bpy.context.screen.areas if a.type == 'VIEW_3D' ][0] override = { 'scene' : bpy.context.scene, 'screen' : bpy.context.screen, 'object' : bpy.context.object, 'area' : a, 'region' : a.regions[0], 'window' : bpy.context.window, 'active_object' : bpy.context.object } bpy.ops.gpencil.data_add( override ) ## End of grease pencil hack for set up, Palette = bpy.context.scene.grease_pencil.palettes.new(name='my-palette') gmat = Palette.colors.new() gmat.name = 'green' gmat.alpha = 1 gmat.fill_alpha = 0.5 gmat.fill_color = [0