0
$\begingroup$

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>
TypeError: bpy_struct.keyframe_insert() property "effector_settings.use_effector" not found

enter image description here


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

$\endgroup$
2
  • $\begingroup$ Thanks for the tip. $\endgroup$ – para8D Feb 21 at 2:58
  • $\begingroup$ 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. $\endgroup$ – susu Feb 21 at 3:43
0
$\begingroup$

I solved it by using:

obj.modifiers['Fluid'].effector_settings.keyframe_insert(data_path="use_effector",frame=5)
$\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.