# How to copy multiple Actions to multiple objects?

Iam trying to assign "ACTION1" and "ACTION2" to several objects.

This is my current code:

def copyAnim(animObj):
context = bpy.context
obj = bpy.data.objects[animObj]
obs = [o for o in bpy.data.objects if o.name.startswith("object")]
action = obj.animation_data.action
print(obs)

for ob in obs:
if ob.animation_data:
ob.animation_data.action = action.copy()
else:
ob.animation_data_create()
ob.animation_data.action = action.copy()

copyAnim('Object_Holding_ACTION1')


But here is the Problem: if i want to add another action (with copyAnim('Object_Holding_ACTION2') ) "ACTION1" gets overwritten.

• Overwritten? each object with name starting with "object" will be assigned a copy of the action on the object named "Object_Holding_ACTION2" – batFINGER Oct 24 '16 at 11:59
• Yea, thats my problem. I want "ACTION1" and "ACTION2" both to affect the objects. – froggyman Oct 24 '16 at 12:41
• Have a look at the NLA – batFINGER Oct 24 '16 at 12:59
• I played around a bit with the NLA. It got almost all functionality i want, but i couldn't get overlapping animations to work. @batFINGER – froggyman Oct 24 '16 at 16:43