Blender Git Loki
Git Commits -> Revision 5a12b7d
Revision 5a12b7d by Joshua Leung (master) November 6, 2009, 11:09 (GMT) |
Driver Scripting: Added RNA functions for adding and removing Driver Targets. Unfortunately, I couldn't do this by simply adding callbacks for the add/remove of the collection, as I've had to add to extra RNA functions to do that. Example usage - driving Lamp Distance with Cube LocZ: myOb= bpy.data.objects["Lamp"] myOb.driver_add("data.distance") # drivers is list of F-Curves that have driver data drivers= myOb.animation_data.drivers distDriver= drivers[0].driver dtar= distDriver.add_target("ctrl1") dtar.id_type= 'OBJECT' dtar.id= bpy.data.objects["Cube"] dtar.rna_path= "location" dtar.array_index= 2 |
Commit Details:
Full Hash: 5a12b7d159371709580cf8fb07fd10d3c3bfdff3
SVN Revision: 24375
Parent Commit: d4fe259
Lines Changed: +99, -3
1 Added Path:
/source/blender/makesrna/intern/rna_fcurve_api.c (+90, -0) (View)