# Filling in Grease Pencil Shapes via Python Script

I am trying to fill enclosed shapes in Grease Pencil using Python Script, as if using the fill tool. There seems to be a Grease Pencil operator, but I haven’t been able to figure out how to use it in the script (bpy.ops.gpencil.fill()). Any help would be much appreciated.

## 1 Answer

bpy.data.grease_pencil["GPencil.001"].palettes["GP_Palette"].colors["Color.002"].fill_alpha = 0.6


-should do the trick. Hover the mouse of the Fill -> Opacity slider in the properties panel(N) and take a look at the command that shows in the popup. Change the names of the "GPencil.001" and the "Color.002" to the ones that the command is pointing to(the ones you are using).