0
$\begingroup$

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

$\endgroup$
0
$\begingroup$

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["Dynamic Paint"].brush_settings.paint_alpha = 0
some_obj.modifiers["Dynamic Paint"].brush_settings.keyframe_insert(data_path="paint_alpha", frame=150)
some_obj.modifiers["Dynamic Paint"].brush_settings.paint_alpha = 1
some_obj.modifiers["Dynamic Paint"].brush_settings.keyframe_insert(data_path="paint_alpha", frame=190)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.