I am trying to add simply a driver to one of the actions and it is asking me for the path, and it is stumping me there. Basically because I have no idea how to get the path it needs to add the driver.
Example:
A word of warning: Since drivers can only ever run after all the animation in the scene has been evaluated, this will NOT update correctly for most cases. I’d advise against trying to do this for any of these settings.
import bpy
for ob in bpy.context.scene.objects:
if ob.animation_data is not None:
action = ob.animation_data.action
if action is not None:
track = ob.animation_data.nla_tracks.new()
strip = track.strips.new(action.name, action.frame_range[0], action)
ob.animation_data.action = None
fcurve = strip.driver_add("scale")
driver = fcurve.driver
driver.type = 'SUM'
var = driver.variables.new()
var.type = 'TRANSFORMS'
#var.targets # <-- has no .new() and there's really no way to do this :/
driver targets can’t be created by python, the RNA methods are missing