# I want to add keyframes for a “Dynamic Paint” modifier setting “Alpha” Using Python

When creating a brush using python I can set the Alpha state using this.

bpy.context.object.modifiers["Dynamic Paint"].brush_settings.paint_alpha = 0


However I would like to set keyframes that turn the alpha setting to 0 for a period of time then to 1 at another time using python. I can't seem to figure this one out.

you can see the problem I am trying to fix here in my latest rendering. The dynamic paint Brushes are painting even before the follow path animations are running. All of the brushes and lasers shown are generated through code. https://www.youtube.com/watch?v=UqiVzTHOTfI

some_obj.modifiers["Dynamic Paint"].brush_settings.paint_alpha = 0