How to link animation data with python I can't seem to link animation data programmatically. I have tried:
bpy.data.objects[&quot;Object_1&quot;].select_set(True)
bpy.data.objects[&quot;Object_2&quot;].select_set(True)
bpy.ops.objects.make_links_data(type='ANIMATION')

When I run this script I get the following:
AttributeError: Calling operator &quot;bpy.ops.objects.make_links_data&quot; error, could not be found

I am not too sure if it is because the second selection should be a shift + mouse click and this isn't reflected in the code (I can't seem to find an option to shift click an object in python) or my script isn't correct.
Would appreciate any help, Thanks in advance!
Make sure you have the right name
The operator is bpy.ops.object.make_links_data()  note it's object not plural.
The error.
&gt;&gt;&gt; bpy.ops.objects.make_links_data()
Traceback (most recent call last):
  File &quot;&lt;blender_console&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/batfinger/blender-git/xxx/bin/2.91/scripts/modules/bpy/ops.py&quot;, line 202, in __call__
    ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator &quot;bpy.ops.objects.make_links_data&quot; error, could not be found

No error.
&gt;&gt;&gt; bpy.ops.object.make_links_data(type='ANIMATION')
{'FINISHED'}

The active object is the source the other selected objects the targets.
Set active object with python.
To sum up, to make links from &quot;Cube&quot; to cones &quot;Cone&quot;, &quot;Cone.001&quot;, &quot;Cone.002&quot; would
obj = context.scene.objects.get(&quot;Cube&quot;) 
if obj:
    context.view_layer.objects.active = obj
    for o in (&quot;Cone&quot;, &quot;Cone.001&quot;, &quot;Cone.002&quot;):
        o.select_set(True)

    bpy.ops.object.make_links_data(type='ANIMATION')