diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-25 12:25:58 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-25 12:25:58 +0300 |
commit | 802779eb2d266f6a1de717fe9e7dcadc9774a7d3 (patch) | |
tree | db1ebf873356493808fe52ba6a9c91a01b8e36aa /source/blender/editors/animation/drivers.c | |
parent | ce4b63aa3f4f892703e6223a2546e067b446a98c (diff) |
Assorted fixes - compile + drivers:
* Fixed a few compile warnings for scons+mingw
* Driver variables are now added with the ID-type set to ID_OB (objects) by default since this is more convenient
Diffstat (limited to 'source/blender/editors/animation/drivers.c')
-rw-r--r-- | source/blender/editors/animation/drivers.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index e731faaf103..d7d3c21607f 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -53,6 +53,7 @@ #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_constraint.h" +#include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_utildefines.h" #include "BKE_context.h" @@ -175,14 +176,17 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla fcu= verify_driver_fcurve(id, rna_path, array_index, 1); if (fcu && fcu->driver) { - fcu->driver->type= type; + ChannelDriver *driver= fcu->driver; + + /* set the type of the driver */ + driver->type= type; /* fill in current value for python */ if (type == DRIVER_TYPE_PYTHON) { PropertyType proptype= RNA_property_type(prop); int array= RNA_property_array_length(&ptr, prop); - char *expression= fcu->driver->expression; - int val, maxlen= sizeof(fcu->driver->expression); + char *expression= driver->expression; + int val, maxlen= sizeof(driver->expression); float fval; if (proptype == PROP_BOOLEAN) { |