I want to write a script that changes the array modifier, and then inserts a keyframe for the new value.
I got it working, but it only does it on the first object. Unselecting all the objects, and then only the one I want to set it to also doesn't work.
Googling some more I found I should use obj.keyframe_insert, but what do I set the data_path to?
Here is an example of what I want to do
obj.modifiers['Array'].count = random.randint(1, 5)
obj.keyframe_insert(data_path=???)
I tried this first.
bpy.ops.anim.keyframe_insert_menu(type='Available')
That works, but only sets it for the first object, the one that was selected; and it was iffy to start off with. I had to manually first set a keyframe, else it said 'Available' was not found.
Copy Data Pathyieldsmodifiers["Array"].count- use''quotation $\endgroup$