hello again from the tube project
trying to produce the functionality of the NLA snowflake button using python (convert linked action to nla) results in a 'no active track to add strip to' error in the console report...
1. open the default scene and insert a keyframe on the default cube
2. put the following into a text editor and hit run script...
import bpy
current_type=bpy.context.area.type
bpy.context.area.type='NLA_EDITOR'
bpy.ops.nla.actionclip_add(action=bpy.context.active_object.animation_data.action.name)
bpy.context.area.type=current_type
...
as far as I can tell this code should convert the action linked to the active object to an NLA strip, as confirmed by Joshua here:
http://blenderartists.org/forum/showthread.php?p=1691416im not sure if this has been broken by the RNA refactor.
also should it be necessary to have to change bpy.context.area.type to 'NLA_EDITOR' given that the only information the operator needs (presumably the active_object and bpy.context.active_object.animation_data.action.name) is available in the 3D view window type?
thanks