From de1c4fafc7ecd644dd9ba06dfc7a4f77b4d06683 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 4 Jul 2011 03:12:28 +0000 Subject: First stages of easier "expressions" creation... It is now possible to create "scripted expression" drivers by simply clicking on some property, and typing some short Python expression prefixed with a '#'. This will result in a scripted expression driver, with the typed-in text being created. For example, you can click on X-Location of the default cube, and type: #sin(frame) and a new driver will be created for the x-location of the cube. This will use the current frame value, and modulate this with a sine wave. Do note though, that the current frame is a special case here. In the current implementation, a special "frame" driver variable, which references the current scene frame is created automatically, so that this simple and (assumed) common case will work straight out of the box. Future improvements: - Explore possibilities of semi-automated extraction of variables from such expressions, resulting in automated variable extraction. (Doing away with variables completely is definitely 100% off the agenda though) - Look into some ways of defining some shorthands for referencing local data (possibly related to variable extraction?) --- source/blender/editors/animation/drivers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/animation/drivers.c') diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 75b54a7529a..c9e422baa3e 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -80,7 +80,7 @@ void free_anim_drivers_copybuf (void); * 1 - add new Driver FCurve, * -1 - add new Driver FCurve without driver stuff (for pasting) */ -static FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_index, short add) +FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_index, short add) { AnimData *adt; FCurve *fcu; -- cgit v1.2.3