Hi Folks,
I am trying to do a script to make drivers between various transform stripe in VSE through python. I am stuck in the middle of targets.id. What target.id will make the link with Scene?
Here’s the problem:
#start
import bpy
second = bpy.context.scene.sequence_editor.sequences_all["[TR]-second"]
root = bpy.context.scene.sequence_editor.sequences_all[’[TR]-root’]
drv = second.driver_add(“translate_start_x”)
#working, creating the driver
var = drv.driver.variables.new()
var.name = “transx”
var.type = “SINGLE_PROP”
#don’t know what target.id should be, tested with target.id.type as well but no luck.
target = var.targets
target.id.type = “SCENE”
target.id = bpy.data.scenes[“Scene”]
target.data_path = sequence_editor.sequences_all["[TR]-root"].translate_start_x
drv.driver.expression = ‘2 * %s’ % var.name
#code end
Error report: AttributeError: ‘bpy_prop_collection’ object has no attribute ‘id’
Please Help!