Sybren Stüvel — Nathan Vegdahl — Christoph Lendenfeld
Shift+G / Select » Grouped
Shift+G
Shift+M / Pose » Bone Collections
Shift+M
Before
After
ob_cube = D.objects['Cube'] ob_suzz = D.objects['Suzanne'] # Create Animation data-block. anim = D.animations.new("anim") # Create outputs for the objects. out_cube = anim.outputs.new(ob_cube) out_suzz = anim.outputs.new(ob_suzz) # Assign the animation. ob_cube.animation_data_create().animation = anim ob_suzz.animation_data_create().animation = anim # Create a layer. lay = anim.layers.new('The One Layer') strip = lay.strips[0] # Animate Cube. strip.key_insert(out_cube, "location", 2, 0.0, 1) strip.key_insert(out_cube, "location", 2, 3.0, 60) # Animate Suzanne. def key(out, rna_path, array, frame): for idx, val in enumerate(array): strip.key_insert(out, rna_path, idx, val, frame) key(out_suzz, "location", (3, 0, 0), 1) key(out_suzz, "location", (3.2, -2.2, 2), 60) key(out_suzz, "rotation_euler", (0, 0, 0), 1) key(out_suzz, "rotation_euler", (0, 0, radians(720)), 60) key(out_suzz, "scale", (0.8, 0.8, 0.8), 1) key(out_suzz, "scale", (1.6, 1.6, 1.6), 60)