diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-07-04 07:12:28 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-07-04 07:12:28 +0400 |
commit | de1c4fafc7ecd644dd9ba06dfc7a4f77b4d06683 (patch) | |
tree | d9d41fdbb5065bb10a05d6314edaf41114d11eec /source/blender/editors/include/ED_keyframing.h | |
parent | e35806470408d01ddaf844c8ebd93fbc2cfdd68d (diff) |
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?)
Diffstat (limited to 'source/blender/editors/include/ED_keyframing.h')
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 294b9b8475a..0ca3a932266 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -225,6 +225,13 @@ typedef enum eCreateDriverFlags { /* -------- */ +/* Low-level call to add a new driver F-Curve. This shouldn't be used directly for most tools, + * although there are special cases where this approach is preferable. + */ +struct FCurve *verify_driver_fcurve(struct ID *id, const char rna_path[], const int array_index, short add); + +/* -------- */ + /* Returns whether there is a driver in the copy/paste buffer to paste */ short ANIM_driver_can_paste(void); |