# Script to Insert Keyframe for Fluid “effector_settings.use_effector” property

I have added a cube as an Effector to a fluid sim. I want to use a script to insert a keyframe for the 'Use Effector' property (see image) Here is what i've got so far:

ob = bpy.context.active_object
ob.modifiers['Fluid'].keyframe_insert(data_path="effector_settings.use_effector",frame=1)


problem is that an error is thrown.

Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\python\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<blender_console>", line 1, in <module>


I will iterate over all selected objects once I have this piece sorted. Cheers

• Thanks for the tip. – para8D Feb 21 at 2:58
• just write an answer and mark it as accepted please. It will help others and to the system it will show that the question has been answered. As it stands there are no valid answers yet. – susu Feb 21 at 3:43

obj.modifiers['Fluid'].effector_settings.keyframe_insert(data_path="use_effector",frame=5)