From 802779eb2d266f6a1de717fe9e7dcadc9774a7d3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 25 Nov 2009 09:25:58 +0000 Subject: 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 --- source/blender/editors/animation/drivers.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (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 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) { -- cgit v1.2.3