3
$\begingroup$

I am trying to load multiple animations, I use dope sheet editor to manage the animations. I have a couple of matrices, what I want to use bone by bone, then insert keyframe one by one. My problem is that I found no way to select the actual animation I would like to set the keyframe.

I am pretty tired of googling since I found only outdated 2.5x stuff.

So my question is: how to change current action on dope sheet with script?

$\endgroup$
0

1 Answer 1

2
$\begingroup$

For me this just worked fine:

#reguirement: you got action called "Idle"
csontvaz_objektumkent = bpy.data.objects[0] #this is actually the armature, but I use index
                                            #because I am lazy
bpy.context.scene.objects.active = csontvaz_objektumkent
csontvaz_objektumkent.animation_data_create()
csontvaz_objektumkent.animation_data.action = bpy.data.actions["Idle"]

I am sorry if it looks bad: I am pretty new to BPY.

$\endgroup$
1
  • $\begingroup$ Edited the answer, because you need to have the armature object selected to have the dope sheet change the animation. Without that this wont work. $\endgroup$
    – Zéiksz
    Sep 18, 2013 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .