Add MULTIPLE actions to an armature

by Jeff Palmer   Last Updated August 13, 2019 21:15 PM

I have made a direct interface with a Kinect2 sensor, via DLL, for MakeHuman. While recording, sensor data is buffered in an array. Once recording has stopped, and an armature is made the active object, a button operation can transfer / re-target the data to the armature.

The problem is I cannot manage to get a single action, meaning there is one named armatureNameAction and another my name (with code & no keyframes) like this:

import bpy
from mathutils import Vector

action = bpy.data.actions.new(name = 'my name')

ob = bpy.context.object
bone = ob.pose.bones['K2-Root']
value = Vector((1, 1, 2))
bone.location = value
bone.keyframe_insert('location', frame = 1)

This can be fixed by not even creating an action & just assigning the name of armature the action like this:

import bpy
from mathutils import Vector

ob = bpy.context.object
bone = ob.pose.bones['K2-Root']
value = Vector((1, 1, 2))
bone.location = value
bone.keyframe_insert('location', frame = 1)

ob.animation_data.action.name = 'my name'

With this way, how does the person make another sensor session & add a 2nd action?



Related Questions


Why can't I create a new action?

Updated April 13, 2018 23:15 PM