Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-12-08 13:36:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-12-08 13:36:46 +0300
commit0391b1ab780b34a149d3c4181d0fe676ef55199e (patch)
treefcc5611cd83129f9c475591d47fb47cea84dc491 /source/blender/makesrna/intern
parent445d077cf4ecc84b5d5cf422bfb2040186d60164 (diff)
compile python driver expressions for faster re-evaluation.
approx 15-25x speedup
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index bf8b74d08ee..e126175a020 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -105,6 +105,13 @@ static void rna_ChannelDriver_update_data(bContext *C, PointerRNA *ptr)
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, CTX_data_scene(C));
}
+static void rna_ChannelDriver_update_expr(bContext *C, PointerRNA *ptr)
+{
+ ChannelDriver *driver= ptr->data;
+ driver->flag |= DRIVER_FLAG_RECOMPILE;
+ rna_ChannelDriver_update_data(C, ptr);
+}
+
static void rna_DriverTarget_update_data(bContext *C, PointerRNA *ptr)
{
PointerRNA driverptr;
@@ -807,7 +814,7 @@ static void rna_def_channeldriver(BlenderRNA *brna)
/* String values */
prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Expression", "Expression to use for Scripted Expression.");
- RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data");
+ RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_expr");
/* Collections */
prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE);