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[&quot;Dynamic Paint&quot;].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
I've found that you can keyframes in many different locations along the data_path, not just at the object level.
This conversation clarified that a bit:
Adding Keyframes to Evaluation-Time Using Python
using-python
some_obj.modifiers[&quot;Dynamic Paint&quot;].brush_settings.paint_alpha = 0
some_obj.modifiers[&quot;Dynamic Paint&quot;].brush_settings.keyframe_insert(data_path=&quot;paint_alpha&quot;, frame=150)
some_obj.modifiers[&quot;Dynamic Paint&quot;].brush_settings.paint_alpha = 1
some_obj.modifiers[&quot;Dynamic Paint&quot;].brush_settings.keyframe_insert(data_path=&quot;paint_alpha&quot;, frame=190)